Docs / Agent prompt

Extensions: agent prompt

A coding-agent prompt for building a plugin, Decisioner or MCP integration from the extension starters.

Back to the Extensions guide

Copy this prompt and replace its final goal with your integration. Each starter archive also contains a focused PROMPT.md.

Extensions prompt
You are helping me build a Riptide extension.

## Product context
Riptide combines an ad server, SSP, and DSP. Choose one of these integration types:
1. Plugin kinds for serving: BID_SOURCE, DEMAND_ADAPTER, ENRICHER, AUDIENCE_EVALUATOR, PRICING_MODULE, CREATIVE_RENDERER, VERIFICATION_VENDOR, DEMAND_ATTACHMENT. Each uses ExtensionService. Run one kind per process.
2. Decisioners: keep the deterministic baseline and evaluate candidate policies or models. Register with kind BASELINE, SIDECAR, or EXTERNAL_ENDPOINT, then assign in SHADOW, BOUNDED_AB, or LIVE mode. Promotion requires measured improvement.
3. Admin API and MCP: call existing operations for administrative work. Adding a core operation requires an OpenAPI change and regenerated MCP descriptors in a customer checkout.

Public overview: https://riptideads.com/docs/extensions

## Choose the integration type
- Custom serving behavior (bids, demand adapters, enrichment, verification, pricing, rendering, audiences, demand attachment) -> plugin kind / ExtensionService sidecar.
- Reporting customization -> query the typed reports catalog and build a client/export integration. New server-side dimensions require a typed catalog/schema change in a customer checkout; reporting is not an ExtensionService kind.
- Bid, floor, traffic shape, pace, creative, audience, insight, anomaly (and related) decisions with baseline + optional model -> Decisioner.
- Administrative application or agent -> existing Admin API or MCP tools. Adding a new core operation requires a customer checkout, Admin OpenAPI changes and regenerated MCP descriptors.

## Start from the published examples
Examples and additional workflow prompts: https://riptideads.com/docs/examples
- EXTERNAL_ENDPOINT Decisioner: download https://riptideads.com/examples/decisioner-http.zip, extract it and read README.md and PROMPT.md. Source mirror: https://github.com/naffis/riptide-example-decisioner.
- ExtensionService sidecar: download https://riptideads.com/examples/extension-sidecar.zip, extract it and read README.md and PROMPT.md. Source mirror: https://github.com/naffis/riptide-example-extension-sidecar.
The archives contain standalone source and tests. A local example can run without platform access; registration requires an authorized Riptide tenant and a reachable deployed service.

## Implementation requirements
- Use the example’s contracts and JSON/proto formats.
- Money and rates are decimal strings with 4 decimal places (for example "2.5000"), never floating point.
- Respect request deadlines and cancellation. Slow or failed sidecars are skipped; Decisioners fall back to the deterministic baseline.
- Keep secrets and tenant account credentials out of code and sample config; use env vars / secret stores.
- Decisioners: implement or keep a deterministic baseline path; register candidates in shadow before live.
- Sidecars: implement riptide.ext.v1.ExtensionService (Describe, Health, Invoke), declare name/version/kind/entitlement/latency budget.
- Request only needed context_fields; receive tenant settings through install-time config, not hardcoded accounts. Respect the host's per-kind fallback semantics.
- Publishing a stack product requires vendor entitlement and operator-verified conformance. The operator runs the harness before recording evidence with runExtensionConformance; that API does not run the harness.
- Install through installStackProduct using listing_id and config_json (a JSON-encoded string). Do not invent a direct tenant-extension create endpoint.
- External HTTP Decisioners require a public HTTPS endpoint; the localhost demo is only a smoke test. Register via createModel and assignModel in SHADOW; promotion uses the operator-gated promoteModel flow.
- MCP uses POST /mcp, initialize then tools/list and tools/call. A registered agent identity must sign the exact request bytes; follow /docs/mcp for key registration, canonical signing, and durable approval tasks.

## What I want you to build
(Replace this section with your goal. Examples: "EXTERNAL_ENDPOINT floor Decisioner that bumps floor by 0.10 CPM for PMP", "BidSource sidecar that bids floor+1 on video", "Enricher that adds a contextual category flag".)

1. Restate which surface and kind you will implement.
2. Download and extract the matching example above, then run its existing tests.
3. Implement the behavior with tests for successful requests, failures, and timeouts.
4. Document configuration, local smoke commands, expected output, deployment prerequisites and the registration API. Include how to disable the integration or return to the baseline.
5. Provide working code and meaningful tests for empty input, invalid input, timeouts, and the chosen behavior. State external services or tenant access still required.

Use the standalone example unless I provide a customer checkout.