Run Your Own Agent or Backend¶
Purpose¶
Run code in your own process using stock model/MCP clients and OTLP. External code does not need a Builder Agent, publication, managed execution context or Agent ID.
Prerequisites¶
An ordinary user/service-account virtual key in the intended Team. Its operations/resources must allow the chosen model/tool and telemetry.ingest for exported spans. Use a service account for durable backend ownership. Obtain the inference and Collector endpoints separately.
Procedure¶
- Create/review a virtual key and store its one-time secret in your process's secret configuration.
- Configure an OpenAI SDK or MCP client, with no direct provider fallback. Set a finite model output bound under finite spending caps.
- If using PydanticAI, create
MissionControlConfig(api_key=...)and anExternalObservationContextfor each observation. Follow the complete adapter guide. - Propagate W3C context and export completed spans through OpenTelemetry. Standalone OTLP requires no preceding inference.
- Inspect the actual Team's Requests/Traces/Usage. Session and customer labels use the key's server-resolved namespaces, not uploaded authority fields.
Expected result¶
Your application remains external; Mission Control governs physical model/tool work and authenticates telemetry independently. Rotating a secret retains its logical key/producer and accounting identity. A service account survives its creator's departure.
Verification¶
Make one allowed bounded call, one disallowed resource call and a standalone export. Check canonical Request evidence, a permitted Team Trace and a forbidden foreign lookup. A successful application result does not prove telemetry delivery.
Failure recovery¶
Reload the process after credential or configuration changes. Correct key/member/service/Team/policy denial rather than registering an Agent as a workaround. Retry failed telemetry independently; do not repeat paid work merely to obtain spans.