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-connectCLI. See Connect your coding agent. - Production traces from your agent. Set
RUNTYPE_ENVIRONMENT=production(orprod) where your agent runs in production. Runtype counts a run as production when itsdeployment.environment.nameisproductionorprod. - Optional: an agent map sent with the
describe_agentstool 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.
Coding agent (MCP)
CLI
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:
Replace the following:
AGENT_NAME: the agent name from your traces or agent map, or its agent ID.PRODUCT_ID: the connected product ID. OmitproductIdwhen your organization has one product or when you pass an agent ID.
For the full input and output schema, see Connect MCP tools.
Run get-agent-profile with your agent’s name or ID:
Replace AGENT_NAME with the agent name from your traces or its agent ID. Run it from the directory that holds your .env or .env.local file, and the CLI picks the product from the ingest key there. Otherwise, pass --product-id PRODUCT_ID, replacing PRODUCT_ID with your connected product ID.
To print the full JSON response instead of the summary, pass --json:
For every CLI option, see Connect CLI.
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:
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 toolsourcelocations, andhandsOffTo. It also lists how people reach the agent (surfaces, each with what that channel allows).declaredis 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.stateiscompared. Otherwise,drift.stateisno_declared_map,agent_not_declared, orno_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):
Replace the following:
AGENT_NAME: the agent name from your traces or its agent ID.VERSION: a positive integer version number from theversionslist.
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 withdescribe_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[].sourceagainst the schema sent in production. Key order doesn’t count as a difference. If production has the newer schema, update your agent map withdescribe_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:
Troubleshoot missing profiles
Use the following checks when get_agent_profile returns no profile or an error:
statusisno_production_traces:profileisnulluntil Runtype reads at least one production trace for your agent. SetRUNTYPE_ENVIRONMENT=production(orprod) where your agent runs in production. Runtype counts a run as production when itsdeployment.environment.nameisproductionorprod. Check whether production runs are arriving by callingquery_traceswithenvironment: "production"(or--environment productionin 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. Runnpx @runtypelabs/connect doctorto confirm which product your.envingest key targets, then pass--product-id PRODUCT_ID(orproductId) with that product ID. AGENT_NOT_FOUNDorPROFILE_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. Callget_statusto check the exact agent names and IDs, or checkversionsfor available version numbers.
Next steps
Continue with one of these guides:
- Score conversations with signals: evaluate production turns with default and custom signals.
- Find issues in conversations: group recurring problems across production runs.
- Run a baseline simulation: test a simulation copy built from your agent’s production traces.
- Trace attributes: review every OpenTelemetry attribute that populates the observed profile.