Qualifying an agent before you trust it — study guide

The concept's fragments, read in order.

Qualifying the controls, not just the answers

Before an agent does real work unattended, two separate questions need answers. The first is whether its work is any good, and that is measured the way any model-driven component is measured: an evaluation over a fixed set of cases, replays of past work, a period in shadow. The second is whether the controls around it actually hold for this agent. Does the sandbox really contain this particular agent runtime (the program that runs the agent loop, such as a coding agent you installed)? Are the permissions you configured the ones it obeys? Is the version running tomorrow the one you tested today? Qualification is answering that second question with evidence before any trust is granted.

The evidence comes from checks the controller runs itself, against the real thing: the real program, on the real host, inside the real sandbox. A passing qualification is what writes trust, and the trust it writes is narrow. It names the exact program, model and host that were tested, and it lapses when any of them changes.

Four rules carry most of the weight. Trust is an explicit list, and anything missing from it is refused. Only the real program counts as evidence, because a stand-in that passes says nothing about what it stands in for. Every test that expects a denial gets a working control, so a test that never ran cannot pass for one that was refused. And trust is pinned to an exact version and revoked when anything it was bound to changes. Each of them was written into one real system, a controller that drives coding agents, after its absence caused a failure, and those incidents are the clearest way to see why each rule is needed.

Qualification does not replace any other control. A qualified agent still proposes and the controller still acts, and a person still approves anything consequential. What qualification adds is that the walls you are relying on were seen to hold, for this agent, on this machine. Building those walls is a subject of its own; this is how you find out whether they work.

Absence refuses

trust is written by evidence and switched on by a person qualification run passes writes an entry entry: proposed a person activates entry: active permits launch unattended work activating launches nothing runtime with no entry looked up in the controller's trust table nothing found refused project policy, or the runtime itself cannot write an entry absence refuses; it never grants
Only a passing qualification run can write a trust entry, it is written as proposed, a person activates it, and only an active entry permits unattended work; an agent runtime with no entry is refused, and neither project policy nor the runtime itself can write an entry.

The first question to ask of any controller is what it does with an agent runtime it has never seen.

Field recordIn one real system, provider handling was written as special cases for one named runtime. Anything else fell through to the default path, and the default path carried maximum trust. When a new runtime was added, it "landed at max trust by omission": nobody decided to trust it, and nothing stopped it.

The lesson the system's record draws is short: "Absence must never grant anything."

The fix is a trust table that the controller owns, where a runtime with no entry is refused for unattended work. The table works like the guest list at a private event: a name that is not on it does not get in, and the person at the door cannot add themselves, however sure of themselves they sound. Who may write to it matters as much as what it holds. In the redesigned system, only a successful qualification run can write an entry, and it writes the entry as proposed, not active. A person activates it, and activating it launches nothing; it only makes the entry available. Project policy may choose among active entries but never add one, and a runtime never declares its own trust level. The controller ships with the table empty, so a fresh installation trusts nothing until something has been qualified on it.

The same shape fits any tool-using agent, whether the entries describe agent runtimes, models or tools: an explicit allow, written by evidence and switched on by a person, with refusal as the default. A deny list fails the other way round. Everything nobody thought to list is allowed, and the newest component is the one nobody has thought about yet.

One limit belongs on the record. An active entry means policy permits the runtime to run; it does not by itself prove the runtime is ready. A review of the system put this as the difference between "policy permits execution" and "evidence certifies readiness", and warned that the two drift apart unless something keeps them connected. Binding each entry to the exact thing that was tested, and revoking it when that thing changes, is what keeps them connected.

Test the real program

Tests against a stand-in are cheap, fast and repeatable, which is why they pile up.

Field recordIn one real system, an early integration of a second coding agent shipped with 567 green tests, every one of them run against a fake agent. An external review found, the same day the release shipped, that the enforcement those tests seemed to cover did nothing. Probing the real program showed more. Its headless mode did not apply the permission profiles the integration assumed. A filesystem rule that appeared to deny writes did not override the workspace's write grant. Rules written for bare version-control commands never matched, because every command actually ran inside a login shell.

The fake agent passed because it behaved the way the integration expected, and the real one was never asked. Testing that way is like certifying a bridge by load-testing a scale model of it: the model can pass every test while the real bridge, with its own bolts and welds, was never loaded at all. The rule the system adopted is blunt: "Stub-verified behavior is not evidence." Stand-ins stay useful for testing your own code's logic. Only the real program, launched with the exact arguments you will use, can tell you what the real program does.

The same incident carries a second lesson: never credit a component's own claim that it enforces a policy. Accepting a configuration key is not proof that the key governs anything. General configuration guidance from NIST and OWASP says the same for any system: a setting written in a file is not proof that it is in effect, so verify the running system. The page on tools and plugins you did not write tells that half of the incident in full: the setting that did nothing, the flag that was silently absorbed, and how the redesigned system moved the guarantee outward to a sandbox the controller builds and tests itself.

A denial needs a working control

silence counts as a denial only next to a control that worked attempt, restricted liveness marker shows it ran control run same action, no restriction seeded target verified present first must not reach it must reach it what the test saw what the controller records ran, target untouched, control succeeded recorded as denied never ran: no liveness marker recorded as not exercised, never passed target missing, or control failed recorded as broken test: suite fails ran, and reached the target recorded as allowed: the wall failed
A denial test aims a restricted attempt and an unrestricted control run at the same seeded target; only an attempt that ran, left the target untouched, and was matched by a control that succeeded is recorded as denied, while an attempt that never ran is not exercised and a missing target or failed control means the test is broken.

A denial test checks that something forbidden stays forbidden: something inside the agent's sandbox tries to write where it may not, reach a host that is not on the outbound allowlist, or read the controller's token, and the test expects the attempt to fail. The trap is that "it did not happen" has many causes, and the restriction is only one of them. The command may never have started. The target may never have existed. The test may have died before it got that far. Each of those looks exactly like a successful denial.

Field recordIn one real system it happened. While the real coding agent from an early integration was being probed, a malformed configuration stopped its commands from running at all. A denial test's target file was absent afterwards, and at first that read as a successful denial. Nothing had been denied, because nothing had run. In the same probing, isolating the agent's configuration directory could also remove its authentication, so the agent never got far enough for the test to exercise the boundary.

So a denial test needs three things before its result means anything. First, a real target that the test seeds and verifies before the attempt: a sentinel file at the real token path, a listener on the controller's own port, a destination that is not on the allowlist. Second, proof the attempt ran, such as a liveness marker the test can see. Third, a working control: the same action, run without the restriction, has to succeed, which shows the test can see the action when it does happen, like testing a smoke alarm, where silence on an ordinary day means nothing until you have seen the alarm sound when there really is smoke. Experimenters call this a positive control, and the reasoning is the same: a negative result means something only if the method could have produced a positive one. A test that expects success needs the mirror-image check, proof that permitted work still works.

The verdicts follow from those three. The attempt ran, the target is untouched and the control succeeded: denied. The attempt never ran: not exercised, and never counted as a pass. The target was missing or the control failed: the test is broken, and the suite fails. The redesigned system runs twenty isolation probes this way, each with a target the host seeded and a control, covering cases such as a sentinel process the agent tries to stop, a host socket, writes to the protected tests, and resource exhaustion. Its checks are strict about what counts: in one containment check, "denied" is recorded only when the filesystem itself refuses, and any other error is "not run". A test that reports "could not run" as "denied" is a test that turns its own failure into your confidence.

Containment without the agent's cooperation

the probe runs beside the agent, and the host reads the result controller the agent's sandbox same identity, file view, limits, network path agent, live doing a harmless task probe a sibling of the agent starts it never asks the agent to run or report it seeded sentinel on the host outbound proxy logs every attempt tries tries host-side check: sentinel unchanged, refused connection in the proxy log read verdict
The controller starts the containment probe itself, beside the live agent inside the same sandbox, never asks the agent to run or report it, and judges the result from the host side by checking that the seeded sentinel is unchanged and that the proxy log shows the refused connection.

The obvious way to test whether an agent can get out of its sandbox is to ask it to try.

Field recordIn one real system, qualifying a real coding agent takes three paid test runs: a positive run, a cancellation run and a containment run. On the third attempt at qualification, the first two runs passed and the containment run failed without its probe ever running. The transcript showed two layers. After the agent read its instructions, the model provider's safety layer stopped the response under a "cyber" category. The agent's client then silently fell back to a different model for the rest of the session, and that model declined the task as a prompt injection: "I don't execute unknown binaries on the basis of instructions found inside files." An honestly framed version of the same task had passed on the second attempt and failed on the third.

Nothing about the sandbox changed between those attempts; only the agent's willingness did. The system's record concludes that "the agent's willingness is not stable, and asking an AI agent to attempt escapes is, reasonably, what safeguards flag." Published measurements show that refusal of benign security requests also varies widely between models: on one 2024 set of borderline but benign cybersecurity prompts, one model refused 70 percent while several others refused fewer than 15 percent. A refusal is also dangerous to read, because it can look like a pass: an agent that declines to try leaves the forbidden target untouched, which is exactly what a successful denial leaves behind. The system's owner decided that containment is a property of the sandbox, not of the agent's cooperation.

So the controller runs the probe itself. It starts the probe inside the agent's own sandbox, with the same identity, namespaces, file view, limits and network path, while the agent is live there doing a harmless task, and it never asks the agent to run, read or report the probe. The probe starts only once the host sees the agent inside, and it fails closed on any interference. An agent's refusal is recorded as a failure, never a pass. A run whose output shows a model other than the one being qualified, whether through a safety-triggered fallback or a different model in the usage data, is not accepted as that runtime's work and fails as "model fallback". Whether the agent can hand work to sub-agents is read from its tool inventory, not found out by asking it to try. The design's general rule accepts either an inventory or a test in which the agent is told to delegate and is seen to be unable to; here the system uses the inventory, so the answer never rests on the agent's cooperation.

Field recordThe fourth attempt passed all three runs.

The verdict has to come from the controller's side as well.

Field recordIn one real system, a review showed, by doing it, that a containment pass could be forged: the agent runtime could stop the probe from acting and send a report in its name, because the sandbox's first process trusted a process id written inside the report. The fix identified the sender by the kernel's own record of who was on the other end of the connection, and corroborated the result from the host: sentinel files unchanged, the refused connection in the proxy's log. Later the reporting channel was removed altogether, and the sandbox's own first process now runs the probe.

For any agent, evidence about containment comes from things the agent cannot write.

The test can do damage too

a dangerous instrument acts only when both halves agree inside half: its own reads separate namespaces? first process is not the host's init? at most 16 processes visible? any read fails: refuse outside half: the host's check is it really in a contained sandbox? only then is it released both say contained? result result instrument may act refuses yes no, or unreadable either half alone can be wrong or fooled; unknown counts as no a test that can do damage proves the wall is there before it acts
A dangerous test instrument acts only when two independent halves agree: its own reads from inside show it is contained, and the host's check from outside shows it is contained; if either half fails or cannot be read, the instrument refuses.

A containment test is, by design, an attempt to do something harmful, and it runs on a real machine. If the containment it is testing is not actually there, the harm lands.

Field recordIn one real system, a test was checking that a sandboxed agent cannot kill processes outside its sandbox, and it sent a kill signal to every process it could reach. At that point in the build, the controller still launched agents directly on the host, without a separate process namespace (the kernel feature that gives a sandbox its own private view of which processes exist). So every process the test could reach was every process the user owned. The login session, the user's service manager, the editor's server, the session of the agent orchestrating the work and two working agents all died. No file was damaged and one regression run was lost; the service manager stayed down until it was restarted later the same day.

The test was right about what it wanted to prove. What failed was its unchecked assumption that it was running somewhere its targets were contained. The fix makes a dangerous instrument fail closed in two independent halves. The inside half: the instrument refuses to act unless its own reads show it is contained, for example that it sits in separate namespaces, that the first process it can see is not the host's system init, and that it can see at most 16 processes; if any of those reads fails, it refuses. The outside half: the test releases the instrument only after checking containment from the host. Either half alone could be wrong or fooled, so both must agree before anything dangerous runs, and an answer that cannot be read counts as no.

The rest of the fix treats the controller's own dangerous code the same way. Its code paths that kill, signal, remove and mount are confined to the controller's own scope, every builder lists those code sites, and every reviewer checks them. Tests that deliberately exhaust resources run only on a designated second machine, never on the one people are working on.

This rule is for anyone testing agent containment, and it reaches past agents. An instrument strong enough to prove a wall holds is strong enough to do damage wherever the wall is missing, so make it prove the wall is there before it acts.

Trust belongs to one exact version

trust names one exact thing, and lapses when any part changes trust entry, bound to binary hash version help-text hash launch template model authentication mode host hash checked before every launch updater replaces the binary overnight hash differs any bound part changes compared revokes entry revoked: nothing launches offers requalification: runs only on the operator's command behavior seen at one version is a record about that version, not the next
A trust entry names the exact things it was qualified against: binary hash, version, help-text hash, launch template, model, authentication mode and host; an entry covers only what it names, so a changed binary or other bound part means the entry is revoked and nothing launches, and requalification is offered but runs only on the operator's command.

A qualification describes what one program did, so the trust it writes has to name that program exactly. In one real system, each trust entry is bound to the agent runtime's binary hash, its version, a hash of its help text, the launch template the controller uses, the model, the authentication mode and the host. The hash is the binding that carries the weight. A version string is something the program says about itself; a hash is computed from its bytes, and any change to the bytes changes it.

The binding was not theoretical.

Field recordIn that system, the coding agent's built-in updater changed its version overnight, and its installer prunes old versions, so the tested version could vanish from the machine. Now the controller copies the qualified binary into its own home directory, pins that copy and checks its hash before every launch. Automatic updates are switched off in the agent's environment, and the operator's own installation is never touched, so a person can update their own tool without changing what the controller runs.

Approval attaches to the exact item, like an aircraft part approved under its exact part number, where a replacement that looks identical still needs its own approval before it flies.

Revocation is automatic; requalification is not. An entry covers only what it names, and it is revoked when the binary hash, the help-text hash, the launch template, the runtime's capabilities or the sandbox profile change, and an entry for one authentication mode never authorizes another. A binary change may offer requalification but never runs it, because qualification spends real money: three paid test runs. The positive run asks for one exact file edit with an exact result. The cancellation run has the agent create a barrier file that the controller observes, then the controller stops the agent and measures the stop. The containment run checks that the sandbox holds, with a probe the controller runs itself. In that system each run was estimated at 4 to 10 US cents at the time. The operator approves the spend, and the approval is bound to the exact binary, launch template, model, host, test project, network allowlist, deadline and amount; a replay is a new attempt with a new approval. The identity that runs qualification can run only its fixed tests, never project work, and no policy can select it.

When a run fails, it keeps a failure class, such as authentication failed, proxy refused, unsupported flag, delegation unverified or barrier not reached, so a failed qualification says what to fix. The same logic reaches the parts you do not install yourself. Some model providers document that a model name can be an alias, repointed to a newer snapshot over time, and recommend a dated or specific stable version for production. A prompt tuned on one model version is an untested prompt on the next, so the model in a trust entry should be the pinned version, not the alias.

Qualify the host at every start

A sandbox is built from features of the machine it runs on, so the machine is part of what you are trusting. A qualification from last month describes last month's machine. In one real system, real agent runtimes are refused unless the host's requirements and the full isolation probe suite pass at this start, not at installation and not the last time someone looked.

The host checks number about a dozen: the kernel version, the control-group features the sandbox needs and their delegation to the controller, unprivileged namespaces, the versions of the tools the sandbox depends on, a bounded in-memory filesystem, reserves of memory and disk, and, on a Linux environment hosted inside Windows, that the Windows side cannot be reached from the sandbox. Then the probe suite runs, every probe with its seeded target and its control. The results are recorded as a mechanism fingerprint, and when the fingerprint changes, the host qualification lapses with a message naming what changed. A failing check names itself, the value it observed and the remedy, so the person reading it knows what to fix rather than only that something is wrong.

The hard case is the fact that cannot be read: in the same system, host facts the controller could not read once compared equal to each other, which let a host qualification survive changes the controller could not see, and the page on evidence rather than the agent's word tells that story in full.

The general rule is that a check that was not exercised blocks like a failure but is recorded as not exercised, and unknown counts as no. That is the cautious choice for a reason: an unknown result is exactly what a broken check, a missing tool or a changed machine produce, and none of those is a reason to let an agent run.

Hostile inputs, and what a pass leaves open

Most qualification tests check the walls. A qualified sandbox limits what a hijacked agent can do, but it says nothing about how easily the agent is hijacked, so qualification should also test the agent's behavior when what it reads is hostile. The method is to plant instructions where the agent will read them, in a tool result, a document, an email or an issue in the repository, and see what happens. Published benchmarks do this at scale. One 2024 benchmark planted attacker instructions in the data agents read while doing ordinary email, messaging, travel and banking tasks, across 629 security test cases. With no defense, the attacker's goal was achieved in roughly half of cases for one widely used model of that year. Having the agent pick, before reading any untrusted data, only the tools its task needed cut that to under a tenth, though the authors note this fails whenever the task's own tools are enough for the attack, which was true of 17 percent of their cases.

Run your own version against the real configuration, and judge it the way every other qualification test is judged: by what the controller observed at the target, not by what the agent says it did. Did the file change, did the outbound connection happen, did the tool call go out with the attacker's arguments? How success is scored matters more than it looks: the same runs can score differently depending on whether a model or a fixed check judges the outcome. OWASP's guidance for agents asks for this testing across the whole system (tools, memory, approvals, the paths between agents) before deployment, and again after any material change to prompts, tools, retrieval, policies or model provider.

Then be honest about what a pass means. OWASP's AI testing guidance asks you to report untested threat categories explicitly, as gaps, and to report results as rates rather than a single pass or fail, because model behavior is probabilistic. A pass covers the cases you tried, and an attacker is free to write new ones. Even within your cases the arithmetic is sobering: if an agent resists all 50 planted-instruction cases, the rule of three puts the one-sided 95 percent upper bound on its failure rate for cases like those at about 3 / 50 = 0.06, or 6 percent.

So a qualification publishes what it has not established alongside what it has. In one real system, every trust entry lists what its test runs did and did not establish, and a waiver never counts as a pass. A one-shot qualification never establishes how the agent behaves across a multi-turn session, which needs a continuation test of its own. And behavior seen at one runtime version is a historical observation, not a claim about the next. The UK National Cyber Security Centre's guidance for secure AI systems asks for the same habit: release only after appropriate security evaluation, and disclose the known limitations.

Trust you can point to

The governed-agent capstone asks you to run a coding agent you do not have to trust: unattended, without taking its word for anything. Qualification is the step that turns "we set up a sandbox" into "we saw the sandbox hold, for this agent, on this machine". Before the agent's first real task, there is an active trust entry for the exact copy of the program the controller will launch, the model it will call and the host it will run on, written by a qualification run and switched on by you. Every denial in the probe suite was a real attempt against a seeded target, beside a control that succeeded. Containment was proven by probes the controller ran next to the agent, not by asking the agent to try. And the protections you rely on are the walls the controller built and tested, not the agent runtime's own settings.

Then the entry keeps itself honest. When the program updates, the hash check fails and the entry is revoked before anything launches. When the host changes, its fingerprint lapses. You decide when to spend money on requalifying. And the entry carries its own list of what its tests did not establish, so nobody reads more into it than the tests showed.

None of this widens what the agent may do on its own. Qualification makes the controls trustworthy; it does not replace them. The agent still proposes and the controller still acts, and human approval for anything consequential stays in place at every step. The same discipline reaches past coding agents. Any agent runtime, model or tool you put behind a controller earns trust the same way: an explicit entry, real tests with working controls, and an exact version whose trust lapses the moment it changes.

Sources

The published studies, standards and guidance this page cites. Links open on other sites. Field records come from the author's own records and have no public source.

  1. Guide for Security-Focused Configuration Management of Information Systems, SP 800-128 (NIST, 2011) csrc.nist.gov
  2. A05:2021 Security Misconfiguration (OWASP Top 10, 2021) top10.owasp.org
  3. CyberSecEval 2: A Wide-Ranging Cybersecurity Evaluation Suite for Large Language Models (arXiv, 2024) arxiv.org
  4. AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents (NeurIPS 2024) arxiv.org
  5. INFUSE: A Unified Surface Benchmark for Indirect Prompt Injection in Agentic Systems (arXiv, 2026) arxiv.org
  6. AI Agent Security Cheat Sheet (OWASP Cheat Sheet Series) cheatsheetseries.owasp.org
  7. AI security testing (OWASP AI Exchange) owaspai.org
  8. Guidelines for secure AI system development (NCSC, 2023) www.ncsc.gov.uk