Skip to main content

Embedded inspector authorization

Formation authorizes embedded inspectors independently of application chat. Developers create a read-only key for one agent, then paste it into their web, native, or command-line inspector. Ordinary app access never grants diagnostics.

Create a diagnostic key

Open Diagnostic keys from the agent page (/agents/{slug}/diagnostic-keys). Name the key (1 to 80 bytes), choose its expiry, and select whether it may read retained content. Keys default to metadata only and 30 days; the maximum lifetime is 90 days. Copy the secret immediately: Formation stores only its hash and never shows it again. Operator API equivalents (existing sign-in and agent authorization required): A key grants agent-wide diagnostics, including other conversations for that agent. It cannot send messages, execute tools, manage keys or change configuration. Retained-content permission is explicit and does not override redaction/retention.

Connect a client

  1. Paste the formation_diag_… key into the inspector. Keep it in memory only. Never embed it in a public environment variable or ship it in an app build.
  2. Call GET /api/inspector/v1/access with Authorization: Bearer <key>. The response contains version: 1, agent_id, agent_slug, current_display_name, include_content, and expires_at. Check the agent against the configured connection descriptor before reading evidence.
  3. Read the API below directly from Formation. No product-server diagnostic proxy, browser approval callback, polling for consent, or shared operator token is needed.
  4. Forget key clears that client only. Revoke in Formation to stop every client using the key. Expiry, revocation, or loss of the creator’s current agent access stops subsequent reads and stream polls. There is no refresh credential.
The bearer-only surface accepts CORS without cookies. Never put credentials in URLs, chat context, logs, exports, or browser persistent storage. A command-line client may obtain its key from a private process environment or secret manager.

Read API

Replace the operator /api/agents/{slug} prefix with /api/inspector/v1/agents/{slug} for these diagnostic operations only: The identity envelope has version: 1, agent_id, agent_slug, current_display_name, and current_backend_build. It describes current metadata, not the historical identity used by an earlier model call. It contains no prompt, settings or credentials. Snapshot/event semantics remain those of live application diagnostics. include_content=true requires retained-content key permission. Missing or pruned bodies remain unavailable. No chat, tool execution, arbitrary operator reads, configuration writes, prompt-snapshot endpoint, or management API is granted. Historical tool definitions and instructions are inspected through retained run inputs. Current setup is read separately through /configuration, described below.

Revocation and failures

Keys bind to a stable agent ID and their creating operator. Every read and stream poll checks database expiry/revocation and the creator’s enabled state, current role and agent grants. Renaming the same agent preserves its key; replacing the agent does not transfer access. Key creation and revocation use the existing attributed mutation audit without recording secrets.
  • 401: missing, malformed, invalid, expired or revoked key. Forget it and paste a valid key.
  • 403: creator lost agent access, or the key does not permit retained content.
  • 404: subject unavailable within this agent, or an unsupported route.
  • 503: authorization storage unavailable; no unprotected fallback.
Do not retry authorization failures in a tight loop. The access response is read-only and never extends a key’s expiry.

Existing temporary sessions

The earlier /sessions and /session browser-consent protocol remains compatible for existing integrations and their original bounded lifetimes. Those credentials use a separate formation_inspector_ prefix. They cannot manage diagnostic keys. New integrations should use developer-entered diagnostic keys instead. This capability does not change application chat transport or make its signing secret safe for public clients. See the embedded inspector design (repository).

Current configuration before the first run

GET /api/inspector/v1/agents/{slug}/configuration?include_content=true reads current agent setup independently of conversations. The existing diagnostic key (or approved inspector session) authorizes it; requesting prompt text and schemas requires the same content grant used for recorded evidence. The version-1 current_configuration response includes captured_at, agent identity, the shared assembler’s current instruction sections, configured tools (native tools, stored MCP tools, and web capabilities under source mesh.web) with explicit availability state (configured, disabled, credentials_required, or unavailable), safe memory settings, and scope limitations. Metadata-only reads omit instruction text, descriptions and schemas. When include_content=true, MCP tool entries carry the provider’s description and include an additive inspector_presentation object (name and group) inside definition_json so clients can display human-readable tool and connection labels alongside the runtime schema. Current configuration never proves that a historical call included a section or tool. Participant, retrieved memories, conversation history and application context remain dynamic; the application owns its current context capture. MCP schemas come only from current stored catalogs through the runtime’s existing selection policy. Missing catalogs are reported explicitly. This read does not connect to providers, refresh credentials, discover tools, retrieve memories, execute a tool, or start a run. A later call may offer a different tool set.