$ fssg build --deterministic --validate |

AI Agent Reliability: Find the Broken Boundary

AI Engineering

When an AI agent fails, “the model was wrong” is usually too coarse to be useful.

A production run crosses several boundaries before it changes the world. The request is interpreted, context is assembled, a proposal is generated, authority is checked, an effect is attempted, state is recorded, and evidence is returned. A defect at any one of those boundaries can look like a bad answer in the final interface.

I debug agent systems by locating the first boundary that stopped preserving its contract. Only then do I decide whether the model needs to change.

The seven-boundary map

This is the compact map I use:

Boundary Question Typical failure Decisive artifact
Intent What outcome was requested? The task was underspecified or silently reinterpreted Versioned task/acceptance contract
Context What did the run know? Missing, stale, poisoned, or oversized inputs Context manifest and source versions
Decision What did the model propose? Invalid structure, unsupported claim, weak plan Raw proposal plus normalized candidate
Authority What was the run allowed to do? Tool availability was mistaken for permission Policy decision and approval receipt
Effect What happened outside the model? Duplicate, partial, timed-out, or irreversible action Stable effect ID and provider receipt
State What can resume or roll back? Checkpoint does not match workspace or external state Bound checkpoint and transition log
Evidence What proves completion? A plausible response was accepted as success Verification result tied to the exact artifact

The map is deliberately not a maturity model. A system does not “graduate” from context to evidence. Every consequential run crosses all seven boundaries, even when some are implemented as a few lines of code.

Start with the first broken invariant

Suppose an agent says that it deployed a service, but the old version is still live. Several explanations fit the same symptom:

  1. The acceptance contract never required checking the public endpoint.
  2. The agent saw an obsolete deployment guide.
  3. It generated the right command but for the wrong environment.
  4. Policy denied execution and the interface hid the denial.
  5. The deployment API timed out after accepting the request.
  6. Local state advanced while remote state did not.
  7. The agent treated a zero exit code as proof of the public result.

Changing the model may alter the wording while leaving every operational defect intact.

The useful debugging question is: what is the earliest artifact that contradicts the intended run? If the task contract omitted public verification, the defect begins at intent. If the contract is precise but the context points to the wrong cluster, context is the first broken boundary. If both are correct and the normalized tool call targets production, inspect authority and effect.

This creates a deterministic investigation path around a probabilistic component.

Boundary 1: intent must become testable

Natural-language requests are useful interfaces, but poor execution records. Before work starts, the runtime should turn the request into a small acceptance contract:

{
  "task_id": "deploy-api-2026-10-06",
  "target": "api-production",
  "expected_revision": "7d18c2a",
  "acceptance": [
    "deployment reports ready",
    "public /health returns 200",
    "reported revision equals 7d18c2a"
  ]
}

This is not an attempt to formalize every sentence. It isolates the facts that determine completion. Without them, later verification can only confirm that something happened.

Boundary 2: context needs identity, not volume

Adding more tokens is not a reliability strategy. The run needs to identify the sources that shaped its decision: repository revision, policy version, tool schema, retrieved document, model configuration, and relevant memory.

That is why I treat context as an execution artifact rather than a long string. A context root can reveal whether two runs used the same declared inputs without pretending their model outputs must match. If a source changes, the system can localize the drift instead of blaming “AI variability.”

Boundary 3: proposals are candidates

The model's answer should enter the system as an untrusted candidate. Normalize it, validate its schema, preserve the original, and record the transformation. The purpose is not to make language generation deterministic. It is to make the handoff inspectable.

A proposal can be semantically weak while structurally valid. That is why schema validation is necessary but insufficient. Evaluators, tests, or human judgment may still be required—but they should judge a named candidate, not a transient chat turn.

Boundary 4: authority is separate from capability

An agent may know that a tool exists and still lack permission to call it. The runtime must resolve authority from explicit policy, scope, risk, and approval—not from the model's confidence.

This is a core responsibility of an AI engineering runtime. It also explains why “available tools” and “allowed effects” must be different data structures. Discovery expands the proposal space. Policy constrains the execution space.

Boundary 5: effects need stable identity

External systems do not share the agent's conversational state. A timeout can mean rejected, accepted, or accepted-but-not-yet-visible. Retrying with a new semantic identity may duplicate the effect.

Assign the intended effect a stable key before the first attempt. Give each attempt its own ID. On uncertainty, reconcile provider state before retrying. The recovery guide distinguishes retry, resume, rollback, compensation, and reconciliation because they are not interchangeable verbs.

Boundary 6: state must describe what can be recovered

A checkpoint is useful only if its recovery scope is explicit. Session state cannot restore a filesystem. A filesystem snapshot cannot reverse an email, payment, or remote deployment. Durable workflow systems make the distinction concrete: Temporal records event history and replays workflow decisions, while external interactions run as activities; LangGraph separates thread checkpoints from cross-thread stores.

The lesson is broader than either framework. State has domains. Recovery must name which domains it restores and which require reconciliation or compensation.

Boundary 7: evidence closes the run

The final answer is not evidence of completion. Evidence is a verification result bound to the requested artifact and boundary:

{
  "task_id": "deploy-api-2026-10-06",
  "artifact": "deployment/api-production/7d18c2a",
  "checks": {
    "provider_ready": true,
    "public_health_status": 200,
    "reported_revision": "7d18c2a"
  },
  "verdict": "accepted"
}

This receipt can still be wrong if its probes are weak or its sources are compromised. Reliability is not certainty. The receipt makes the claim local enough to challenge, replay, and improve.

A practical triage sequence

When a run fails, I inspect boundaries in this order:

  1. Re-read the acceptance contract.
  2. Compare the context manifest with the intended environment.
  3. Inspect the original and normalized proposal.
  4. Read the policy decision, including denials and waivers.
  5. Reconcile every uncertain external effect by stable ID.
  6. Compare local, workflow, and external state.
  7. Re-run the decisive verification probe.

Do not begin by rewriting the prompt. Prompt changes are justified when the first defect actually appears at the decision boundary. Otherwise they introduce a new variable while preserving the original fault.

What this map does not guarantee

The map does not guarantee true model claims, reversible third-party effects, perfect evaluators, or exactly-once delivery. It gives each failure a smaller address. Some systems can collapse boundaries for low-risk read-only work; consequential actions should keep them explicit.

The model remains probabilistic. The investigation path does not have to be.

Sources

FACET AI CLI Terminal
facet@ai:~$