# Harness Audit

> Audit an AI agent's production harness as a release-specific assurance case using repository and runtime evidence. Use for launch-readiness, security, governance, due diligence, control-gap, or post-incident reviews of tool-using, stateful, extensible, long-running, or delegating agents. Produces an impact-tiered launch decision and a focused, evidence-backed fix queue. Do not use for model-only evaluation or as a substitute for authorized runtime testing.

- Skill: `contextosai/harness-audit` (Agent Skill, multi-file: 7 files)
- Install (CLI): `npx skillmds@latest add contextosai/harness-audit`
- Raw SKILL.md: https://api.skillmd.com/api/skills/contextosai/harness-audit/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: contextosai (https://skillmd.com/u/contextosai)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/contextosai/harness-audit

---


# Agent Harness Audit

Audit one **evaluated runtime release**, not an abstract architecture or a list
of controls. The release includes everything that can shape behavior,
authority, state, effects, observation, or recovery: model and routing,
harness, instructions, extensions, tools, identities, policy, context, memory,
sandbox, orchestration, evaluators, telemetry, deployment bindings, and
recovery configuration.

Build a falsifiable assurance case around one rule:

> **No causal chain, no assurance.** A safeguard counts only when evidence
> connects the deployed release to its invocation before the protected
> boundary, a representative challenge, an independent observation of the
> result, and the absence of a credible bypass to the same effect.

Keep three judgments independent for every material claim:

- **Effectiveness:** does the mechanism stop or bound the scoped failure?
- **Evidence level:** is it merely asserted, defined, wired, challenged, or
  observed in this release?
- **Confidence:** how complete, current, representative, and trustworthy is the
  evidence?

Never average these into a readiness score. One reachable critical bypass
outweighs a large inventory of low-impact controls.

## Load the method

Before judging, read:

- [audit-rubric.md](reference/audit-rubric.md) for impact tiers, the release
  manifest, claims, capability modules, evidence levels, lifecycle coverage,
  proof packets, and launch gates.
- [report-template.md](reference/report-template.md) for the required output.

Read [research-basis.md](reference/research-basis.md) only when explaining or
changing the method, choosing an evaluation for a novel surface, or resolving
a methodological dispute.

## Inputs and evidence boundary

Use the repository path as the target; default to the current working
directory. Also collect, when available:

- intended users, environment, data, tools, autonomy, persistence, effects,
  and accepted harm ceiling;
- the release manifest and deployment bindings;
- tests, evaluation results, trajectories, decision records, effect receipts,
  incidents, approvals, and recovery drills.

Do not block the audit because runtime evidence is unavailable. Declare the
mode as `code-only`, `code+tests`, or `code+tests+release-observation`; label
assumptions; mark inaccessible material **Not verified**; and state the exact
access or experiment needed. Inaccessible is not absent, and absent is not
automatically N/A.

## Workflow

Follow the sequence below. Preserve contradictory evidence, uncertainty, and
release linkage instead of smoothing them into a narrative.

### 1. Pin the decision scope

Define the release, intended deployment, decision being made, and highest
reachable impact tier using the rubric. Reconstruct the complete release
manifest from immutable versions or hashes where possible. Treat any
behavior-, authority-, evidence-, or recovery-shaping component that is not
pinned as drift or **Not verified**, not as a documentation nicety.

State what this audit can and cannot decide. A narrower enforced deployment
scope may lower reachability; an informal usage promise may not.

### 2. Map reachability and authority

Run the deterministic prescan:

```bash
node "$SKILL_DIR/scripts/prescan.mjs" <target-path>
```

Use `--json` for machine-readable output. If Node is unavailable, search with
`rg`. Prescan hits are leads, not findings; open every material artifact.

Build an access-and-influence graph that traces sources through decisions and
capabilities to resources and effects. Include principals, workloads,
delegation, credentials by reference, instruction and data sources, tools,
memory, scheduled work, child agents, destinations, side effects, monitors,
cut points, and recovery owners. Record the identity, purpose, authority,
tenant/object scope, trust, persistence, and correlation identifier on each
material edge.

Determine effective authority from the intersection of what the manifest,
workload, delegated principal, resource audience, compiled capabilities,
policy, approval, and run budget actually permit. Then search for:

- composite paths where untrusted influence crosses individually legitimate
  permissions to reach a sensitive or irreversible sink;
- alternate dispatch, direct SDK, dynamic loading, fallback, stale-worker,
  over-broad credential, and recovery-path bypasses;
- release drift and whether revocation reaches active credentials, queued work,
  children, sessions, approvals, schedules, state, and pending effects.

Mark each capability module from the rubric **Applicable** or **N/A with
factual reachability evidence**. A reachable capability lacking a safeguard is
not N/A.

### 3. Turn paths into proof obligations

Complete the lifecycle matrix from the rubric. Create at least one concrete
scenario for every applicable phase and one chain that crosses phases. Cover
benign success as well as misuse, indirect influence, compromised dependencies,
wrong-object or wrong-tenant actions, model error, timeout/retry, stale
authority, partial effects, cancellation, persistence, and failed recovery
where reachable.

Write each critical scenario as an observable obligation:

```text
Given <principal, authority, release, and starting state>, when <failure or
adversary> influences <boundary>, the harness must preserve <invariant> at
<cut point>, prove <postcondition>, and leave <defined recovery state>.
```

Assess every core claim and applicable module. For each one:

1. Trace the enforcement chain from deployed entry point to protected effect.
2. Identify the earliest feasible cut point and the independent oracle.
3. Search for bypasses and record counterevidence.
4. Cite the smallest safe code, configuration, test, trace, decision, receipt,
   or deployment reference that supports the judgment.
5. Assign status, evidence level, and confidence separately using the rubric.

When behavior depends on instructions, create the rule registry required by
the rubric and evaluate precedence, applicability, required acts, forbidden
transitions, and observable milestones. Prompt presence proves exposure only
when the compiled context contains it; exposure does not prove compliance.

### 4. Challenge the deployed behavior

Choose evidence by critical path and impact tier, not by a fixed number of
tests or traces. For each critical path, seek a matched set of:

- benign success;
- deny, clarify, or minimum-authority boundary behavior;
- fault or partial-effect behavior;
- realistic indirect or lifecycle attack;
- recovery and selective repair.

Judge each set through four independent lenses: external outcome, rule
compliance at the moment it mattered, runtime authority/state/containment, and
cost per accepted trusted outcome. Use repeated trials for stochastic behavior
and repeated attacker opportunity. Prefer deterministic state and policy
oracles; validate and pin any semantic judge.

Follow the module-specific evaluation requirements in the rubric. In
particular, use paired activation and isolation trials for behavior packages;
test memory from capture through later adoption, effect, and selective repair;
and measure oversight by residual-risk reduction and reviewer false negatives,
not reviewer presence. Keep native events, portable trajectories, operational
spans, and decision records distinct, and disclose conversion loss.

For every consequential action, require the effect proof packet defined in the
rubric. A completion message, `200 OK`, `success: true`, model self-report, or
uncorrelated log does not prove the external postcondition.

Do not perform risky live actions merely to close an evidence gap. Run
behavioral tests only when authorized and isolated with reversible fixtures.
Otherwise specify the exact scenario, fixture, oracle, expected safe state,
and evidence the system owner must return.

### 5. Make the launch decision

Apply the highest triggered gate in the rubric:

- **BLOCKED:** a required critical claim is Ineffective or Not verified,
  release drift is unresolved, required evidence is missing, or a credible path
  reaches unacceptable harm.
- **CONDITIONAL:** explicit, enforced, expiring constraints make the risky path
  unreachable or lower its tier, and the constraint has the required evidence.
- **READY:** all tier-required claims and modules clear their gates for the
  pinned release, lifecycle scenarios are adequate, consequential effects are
  proven, and residual risks have owners.

A code-only review can establish design assurance but cannot clear a T2 or T3
runtime. Always state decision scope, confidence, evidence freshness, residual
risk, and any constraint's owner and expiry.

### 6. Report the critical path and closure plan

Use [report-template.md](reference/report-template.md) without inventing a
parallel report structure. Lead with the highest-impact reachable path and the
first failed proof obligation, then show the evidence and counterevidence that
drive the decision.

Keep at most five active fixes. Each fix must name the earliest feasible cut
point, mechanism, owner placeholder, dependency, expected closure evidence,
and re-audit trigger. Prefer a load-bearing fix that closes several paths over
many cosmetic controls.

## Non-negotiable judgment rules

- The model may propose actions; it cannot grant authority, approve its own
  policy, or independently verify its own effect.
- Treat configuration, extensions, tool descriptions, memory, approvals,
  evaluators, and recovery logic as behavior- or authority-shaping supply-chain
  surfaces.
- Transformation may improve relevance; it must not silently raise trust or
  authority.
- Distinguish prevention, detection-before-impact, detection-after-impact,
  containment, repair, compensation, and recovery.
- Completion is not safety. Detection language is not prevention. Consensus is
  not independent evidence. Human presence is not effective oversight.
- Evaluate required acts and forbidden acts. Omission is a first-class failure;
  refusing every task is also a reliability defect.
- Redact secrets, personal data, raw prompts, and sensitive tool arguments while
  preserving hashes, classifications, and verifiable references.
- Require the assurance outcomes, not a particular framework, policy engine,
  trace vendor, terminology, or trajectory format.

