ENGINEERING NOTE / AI AGENTS

AI agent configuration at runtime

A workspace configuration can leave the model unset while the runtime selects a default. Checking an agent’s setup means inspecting that resolved state as well as the configuration files. This note uses Codex and RuntimeTruth as an example.

CONFIGURATION

Record where each value came from.

Declared configuration is input to the runtime: a model name in a file, a permission setting or a configured MCP server. It records what was requested.

Resolved state is the result of applying defaults and configuration precedence. The model reported for a thread belongs here, including when the workspace configuration left it unset.

Live observations come from inspecting the environment during collection: the bytes of an instruction file, for example, or the tool catalogue returned by an MCP probe.

These distinctions need to survive in the snapshot. A guessed default is not a resolved value. A missing field and an explicit null also need separate representations; otherwise a comparison can lose the difference between absent and empty data.

CODEX

Let the runtime resolve the workspace.

RuntimeTruth reads canonical workspace configuration through the Codex app-server. Its optional thread probe creates an ephemeral thread, allowing Codex to resolve the effective model, provider, approval policy, sandbox settings and instruction-source paths. It does not start a model turn.

runtimetruth inspect codex . --resolve-thread --pretty > baseline.json

This describes a newly created thread for the current workspace. It does not show which settings an earlier conversation used. Keeping the probe’s scope explicit avoids presenting a fresh configuration check as an inspection of an existing turn.

Using the app-server also leaves configuration precedence with Codex. A separate parser would have to track those rules as they change. The adapter and collected fields are documented in RuntimeTruth’s architecture.

FILES AND TOOLS

Keep fingerprints tied to the observation.

Codex-reported instruction paths let the collector read and hash those files without storing their plaintext. A fingerprint identifies the bytes read at collection time. It cannot establish the exact prompt later sent to a model, or rule out a file change between inspection and use.

An MCP catalogue has a similar limit: it describes the exposed tools and schemas at the time of the probe. It does not establish how the server implements those tools or whether a change is backwards compatible. MCP probing is a separate option because it can contact configured servers or refresh authentication, as described in the CLI documentation.

BASELINE CHECKS

Choose which changes should fail verification.

Review the captured snapshot before adopting it as a baseline. Then select the fields that matter to the check. For example, a CLI version update may be acceptable while a change to the effective model, sandbox or instruction files should block a deployment.

runtimetruth verify baseline.json --codex . --resolve-thread \
  --protect codex.thread.model \
  --protect codex.thread.sandbox \
  --protect codex.instructions

Capture timestamps are excluded from comparison. The selected values are checked using the snapshot’s comparison rules: exit code 0 means they match, 2 reports drift, and 1 reports a collection, input or comparison error. Invalid selectors must fail the check. The CI guide documents that contract.

A passing result covers the selected values. It does not validate unprotected fields, establish that the baseline was correct or guarantee how the agent will behave. Those remain separate review decisions.