Skip to navigation

Read the observed profile

Read an agent’s observed profile to see which system prompts, tools, and models run in production and check for drift. Drift is any difference between what your agent map declares and what production traces show. For how Runtype builds observed profiles and compares them with agent maps, see How Runtype works.

Before you begin

Make sure you have the following in place:

  • A repository connected to Runtype. See Connect a repository.
  • Either the Runtype Connect MCP server in your coding agent or the runtype-connect CLI. See Connect your coding agent.
  • Production traces from your agent. Set RUNTYPE_ENVIRONMENT=production (or prod) where your agent runs in production. Runtype counts a run as production when its deployment.environment.name is production or prod.
  • Optional: an agent map sent with the describe_agents tool to check for drift. See Describe your agents.

A profile appears within about an hour of the first production run, or right away the first time you call get_agent_profile.

Get an agent profile

You can read a profile from your coding agent or from your terminal. Both paths return the same data, and both work for an unclaimed organization before you claim it with npx @runtypelabs/connect claim. See Claim an unclaimed organization.

Ask your coding agent to call the get_agent_profile tool with your agent’s name or ID. The following input reads the newest profile for one agent:

get_agent_profile arguments
{
"agent": "AGENT_NAME",
"productId": "PRODUCT_ID"
}

Replace the following:

  • AGENT_NAME: the agent name from your traces or agent map, or its agent ID.
  • PRODUCT_ID: the connected product ID. Omit productId when your organization has one product or when you pass an agent ID.

For the full input and output schema, see Connect MCP tools.

In a terminal without --json, the CLI prints a summary of the observed profile, the declared map entry, and any drift. The output is similar to the following:

CLI output
support-bot (agent_1) in product product_1
Profile version 2: 25 conversations, 30 runs, 2026-11-11 to 2026-11-24
1 prompt, 3 tools, models: gpt-5.4-mini
Declared in agent map version 3 (2026-11-24), entry point
Role: Answers support questions
Prompt: 70 characters, from src/prompts/support.md
Tool close_ticket: src/tools/tickets.ts:12
Tool issue_refund: no source
Tool lookup_invoice: src/tools/invoices.ts:4
Hands off to: billing-bot
Reached through: chat
Some declared text was cut or left out. Ask for the detailed format, or read the whole agent map, to get everything.
Drift against agent map version 3: differences found
Prompt: different (compared as text, ignoring line endings, blank lines and indentation)
- Escalate refunds.
+ Answer billing questions.
Declared, never seen in production: issue_refund
Seen in production, not declared: send_email (4 calls)
Input schema differs: lookup_invoice
Not compared: close_ticket (schema not captured)

Read the result sections

The get_agent_profile response groups observed data, declared metadata, version history, and drift into four sections:

  • profile: what your agent did in production over the last 14 days (up to 500 runs). It lists system prompts, called tools with call and error counts, and models used. Without content capture, prompts appear as hashes and counts only.
  • declared: what your newest agent map declares for your agent, including its role, entry-point status, prompt and tool source locations, and handsOffTo. It also lists how people reach the agent (surfaces, each with what that channel allows). declared is empty when no agent map names this agent.
  • versions: the 20 newest profile versions.
  • drift: comparison between the selected profile version and your newest agent map. When both sides exist, drift.state is compared. Otherwise, drift.state is no_declared_map, agent_not_declared, or no_production_traces.

View full declared prompts and tool schemas

By default, Runtype shortens the declared prompt and tool descriptions and leaves out tool input schemas. Pass --response-format detailed (or responseFormat: "detailed" in get_agent_profile) to return them in full.

Check profile versions and refreshes

Runtype starts a new profile version when production changes its system prompt, its tools or their input schemas, or its models. New run counts update the current version, and the profile picks up new production runs within about an hour.

To read an earlier snapshot and compare it against your newest agent map, pass --version VERSION (or version in get_agent_profile):

Read an earlier profile version
npx @runtypelabs/connect get-agent-profile AGENT_NAME --version VERSION

Replace the following:

  • AGENT_NAME: the agent name from your traces or its agent ID.
  • VERSION: a positive integer version number from the versions list.

Resolve drift between code and production

When production traces and your agent map disagree, production wins. Runtype uses observed production behavior for analysis and simulations.

drift.drifted is true when any prompt or tool comparison finds a difference. Use the following actions to resolve each kind of drift:

  • Prompt differs: compare the diff with the prompt at declared.prompt.source. When prompt text is captured, Runtype ignores line endings, blank lines, and indentation. Without content capture, Runtype compares exact hashes, so whitespace changes also count. If production runs the intended prompt, update your map with describe_agents. If production is behind your code, deploy the updated prompt and check again after new production runs arrive.
  • Tools declared, never seen in production: confirm whether the deployed agent registers the tool or whether you removed it from code. If you removed it, send an updated map with describe_agents.
  • Tools seen in production, not declared: add the missing tool to your agent map with describe_agents, or remove an unintended tool from the deployed agent.
  • Input schema differs: compare declared.tools[].source against the schema sent in production. Key order doesn’t count as a difference. If production has the newer schema, update your agent map with describe_agents. Otherwise, deploy the updated tool schema.

Clear tools listed as unknown

Tools in drift.tools.unknown (shown as Not compared in the CLI) don’t count as drift because one side couldn’t be read. The following table explains each reason value and how to enable comparison:

ReasonWhy the tool wasn’t comparedHow to fix it
schema_not_declaredThe agent map omits inputSchema for this tool.Add inputSchema for the tool and run describe_agents.
schema_not_capturedProduction traces carried no input schema for this tool.Export gen_ai.tool.definitions with your traces.
schema_not_storedThe production schema was too large to store (over 32 KB).Keep tool schemas within 32 KB, or inspect the schema directly in code.
definitions_not_capturedContent capture is off or no tool definitions arrived in the 14-day window, so Runtype can’t tell an uncalled tool from a missing one.Enable content capture and tool definitions. See Control what content is sent.
list_truncatedThe profile reached its 200-tool limit, so unlisted declared tools might still run in production.Reduce the number of distinct tool names emitted, or inspect tools in code.
tools_not_recordedProduction spans show calls to the tool, but the tool calls weren’t linked to this agent.Send traces using the product’s RUNTYPE_INGEST_KEY from .env.

Troubleshoot missing profiles

Use the following checks when get_agent_profile returns no profile or an error:

  • status is no_production_traces: profile is null until Runtype reads at least one production trace for your agent. Set RUNTYPE_ENVIRONMENT=production (or prod) where your agent runs in production. Runtype counts a run as production when its deployment.environment.name is production or prod. Check whether production runs are arriving by calling query_traces with environment: "production" (or --environment production in the CLI). See Read traces and runs.
  • The error names PRODUCT_REQUIRED: your organization has more than one product and the request didn’t name one. Run npx @runtypelabs/connect doctor to confirm which product your .env ingest key targets, then pass --product-id PRODUCT_ID (or productId) with that product ID.
  • AGENT_NOT_FOUND or PROFILE_VERSION_NOT_FOUND: the agent name doesn’t match any agent from your traces (gen_ai.agent.name) or agent map for that product, or the requested version number doesn’t exist. Call get_status to check the exact agent names and IDs, or check versions for available version numbers.

Next steps

Continue with one of these guides: