Sandboxed Adversarial Test Harness / Drydock Safety Engineering
Design a proving ground whose safety does not depend on the code being tested. The
subject may be buggy, malicious, confused, recursively agentic, or silent. The
controller outside it must still bound effects, resources, authority, and evidence.
Non-Negotiable Halt Gate
This skill designs and audits the laboratory. It does not authorize launching the
subject. Obey any operator or incident halt before all other steps. During a halt,
limit work to inert source inspection, schemas, fixtures, models, and documents. Do
not start the daemon, UI, agent backend, test suite, workflow, or provider canary to
“see what happens.” A design review is not a run lease.
Composition Boundary
Drydock proves or falsifies one concrete implementation at one named capability
tier. It does not invent production identity, rebodiment, or capacity policy.
When continuity is in scope, consume a schema-valid resurrection plan from
agent-resurrection-and-body-continuity; when model allowance is in scope,
consume schema-valid capacity evidence from
context-economics-for-agent-swarms. A Drydock PASS cannot turn either artifact
into launch authority.
Use This For
- Designing a VM or microVM laboratory for arbitrary code or agent runtimes.
- Moving integration tests off the developer/CI host and into disposable guests.
- Defining a typed broker for model, fixture, artifact, or simulated remote effects.
- Proving protocol exposure and actual financial exposure as separate properties.
- Building deterministic fault, race, crash, retry, and multi-worker simulations.
- Defining host-observed receipts and promotion gates that a guest cannot forge.
- Auditing an existing sandbox claim before it gains credentials, network, or money.
Do Not Use This For
- Ordinary unit, product, or UX correctness review.
- Training or fine-tuning agents; use
agent-rl-sandbox-trainer after containment.
- Claiming a worktree, path check, container, Seatbelt profile, seccomp filter, or
proxy variable is a complete hostile-code boundary by itself.
- Executing pull-request-controlled configuration, setup, transforms, or tests on
the host merely because the product binary runs in a guest.
- Calling an internal reservation ledger a hard provider bill cap.
Expertise Map
| Question |
Required expertise |
Load |
| Which language and process may hold each authority? |
TCB minimization, cross-language protocol, release independence, fail-cheap packaging |
references/implementation-language-and-fail-cheap-controls.md |
| What belongs outside the adversary's control? |
TCB design, virtualization, kernel isolation, device topology |
references/isolation-mechanisms-macos-linux.md |
| Can any effect bypass the broker? |
Capability security, protocol framing, network and artifact mediation |
references/isolation-mechanisms-macos-linux.md |
| Can the bill exceed the operator's consent? |
Integer accounting, concurrency, provider quota semantics, reconciliation |
references/spend-custody-and-accounting.md |
| Can a race or crash be replayed? |
Deterministic simulation, fault injection, state exploration, safety/liveness |
references/deterministic-simulation-and-formal-models.md |
| Can a crash orphan a body or multiply spawns? |
Durable admission, identity/body separation, process witnesses, scoped breakers, backend handoff |
references/agent-lifecycle-and-crash-storms.md |
| Who can truthfully attest what happened? |
Supply-chain provenance, witness classes, append-only receipts |
references/provenance-receipts-and-evidence.md |
| Which attacks must the gate cover? |
SSRF, traversal, exfiltration, resource, authority, billing, replay, teardown |
references/threat-classes-and-adversarial-recipes.md |
If one person cannot answer all required questions, that is a review-composition need,
not permission to blur the answers. Record the missing expertise and block the tier
that depends on it.
Evidence, replay, and promotion boundary
See field evidence and uncertain effects for the route/witness/effect matrix and promotion boundaries.
A sandbox label is a hypothesis until each claimed boundary has independent evidence.
For every attack case, record the route attempted, boundary expected to stop it,
controller/broker decision, independent host or provider witness, effect truth, and
replay recipe. A missing receipt after process death or network loss is
UNKNOWN/HOLD; query the independent target before any retry. Reset the guest,
ledger, credentials, provider fixture, virtual clock, and schedule deterministically
between repetitions, and record any state intentionally retained.
Keep evidence classes separate: fake/simulated, replayed fixture, host-observed,
broker-observed, model-checked, and provider-reconciled. A result promotes only the
exact tier and route it tested. Schema or lint success does not establish isolation;
a guest report does not establish host truth; a local reservation does not prove a
provider-enforced spend ceiling. While the operator halt applies, dynamic tiers stay
NOT_PROVISIONED or BLOCKED; no test execution is authorized by this skill.
- Adversarial run and deterministic replay
- Evidence tier and allowed claim
- Lost acknowledgement and effect reconciliation
Drydock Review Process
flowchart TD
A[Honor halt and define exact claim] --> B[Name subject, operator, assets, adversary]
B --> C{Can subject execute arbitrary code?}
C -->|Yes| D[Require disposable VM or microVM boundary]
C -->|No| E[Justify narrower process boundary]
D --> F[Keep keys ledger kill and receipts outside guest]
E --> F
F --> G[Seal source tests image scenario policy and prices]
G --> H[Start with no network host mount secret or ambient socket]
H --> I[Add only lease-bound typed broker channels]
I --> J[Derive limits from observed payload and host policy]
J --> K{Real provider requested?}
K -->|No| L[Use fake replay or local model]
K -->|Yes| M{Provider independently enforces loss ceiling?}
M -->|No| N[Deny real-provider tier]
M -->|Yes| O[Prove isolated custody and enforcement tolerance]
L --> P[Define deterministic seeds schedules faults invariants]
O --> P
P --> Q[Collect host and broker witnessed receipts]
Q --> R[Run stable adversarial gate IDs]
R --> S{All required evidence complete?}
S -->|No| T[FAIL INVALID INCOMPLETE or UNCERTAIN]
S -->|Yes| U[PASS exact tier only]
1. State the proposition
Write one falsifiable sentence: “Exact subject digest X, under scenario Y and tier
Z, cannot exceed effects E, resources R, protocol exposure P, or provider loss F;
the named external witnesses can reconstruct every terminal path.” Avoid “safe.”
2. Draw the trusted computing base
List the transitive closure of components trusted to enforce or report the claim.
The subject, its dependencies, its tests, and its agent are untrusted. The controller,
broker, signing key, ledger, halt state, and final verdict must be outside the guest
and inaccessible from guest-writable storage. Minimize this set.
While an operator halt is active, this skill can produce static D0 design and
validation only. Every dynamic tier is NOT_PROVISIONED or BLOCKED, never PASS.
Building D1 in a separate Drydock project needs its own later authorization; the
existence of this skill does not authorize execution of the subject.
Choose implementation languages by authority, not fashion. The Drydock default is
a Rust controller/watchdog/broker/transition core, a tiny out-of-process Swift
Virtualization.framework adapter on macOS, upstream Firecracker plus a Rust adapter
on Linux, and a read-only TypeScript/React evidence viewer. Rust reduces
memory-unsafe TCB risk; it does not supply isolation. Read
references/implementation-language-and-fail-cheap-controls.md before adding a
language, process, provider adapter, database writer, UI mutation path, or retry.
3. Choose isolation by adversary strength
- Pure inert data or a total function may use a process boundary if the narrower
claim is explicit.
- Arbitrary code, package hooks, test configuration, shell, native modules, agent
tools, or a daemon require a disposable VM or microVM.
- Namespaces, Landlock, seccomp, cgroups, Seatbelt, and path guards are defense in
depth. They do not turn the same host identity into an independent jailer.
Record devices and mounts by enumeration. For hostile runs, empty network and
directory-sharing device lists are the baseline. “No route” must be proven from
host configuration, not inferred from a failed guest request.
4. Seal every executable input and exclude the canonical checkout
Content-address the guest image, source tree, test bundle, configuration, scenario,
policy, price catalog, fixture set, and controller build. Treat submitted Jest
configuration, transforms, setup, shell hooks, and tests as executable adversary
input. Run them inside a disposable guest or second test-runner guest, never on the
developer or CI host.
Fetch the exact remote commit into a dedicated bare source vault and materialize it
through a fresh linked worktree. Never package, test, stage, commit, or promote from
the canonical checkout. It must remain an exact clean projection of the live
origin/main tree and be absent from the guest. Guest work stays in guest-local
worktrees; approved output may enter only a fresh host linked review worktree on a
non-default branch. Record before/after canonical integrity receipts, but rely on
path and authority absence for prevention.
4.5 Account for every agent body before launch
Containment does not prove how many workers exist. When the subject can launch,
retry, resume, or replace an agent-like process, require one external durable
admission writer before every ingress. Separate the durable agent node, admitted
run, expiring body generation, backend session, host process/VM witness,
transcript, and capability set.
Reserve global and scoped capacity before asynchronous launch. Start every
controller boot with admission closed until all nonterminal runs and platform
handles reconcile. Treat a PID as one field in a host witness, never as identity.
Set automatic agent-birth retries and child depth to zero in the first tier. A
durable safety breaker survives restart, reboot, deployment, and calendar reset.
Read references/agent-lifecycle-and-crash-storms.md before designing an agent
launcher, process registry, retry, startup recovery, remote session, or backend
handoff.
5. Make channels absent before making them filtered
Start with no network device, no shared home, no canonical socket, no credential,
no production remote, and no writable host mount. Add only run-scoped typed
channels. Every channel names request/response byte limits, concurrency, deadline,
idempotency, replay, cancellation, destination, and receipt behavior.
6. Derive authority from what the broker observes
The guest may request less authority; it never declares the billable input or the
maximum used for admission. The broker resolves or receives the actual bounded
payload, recomputes digests and sizes, inventories media and tools, and derives
provider-specific conservative token and fee bounds. Unknown input kinds or stale
prices deny real dispatch.
7. Prove financial and subscription-capacity bounds
- Protocol-authority ceiling: durable broker reservation limits what the
broker is allowed to send.
- Billable financial-loss ceiling: an isolated provider account, project, key, or
payment rail independently refuses charges above the approved amount, including
a measured worst-case enforcement lag.
- Subscription-capacity envelope: documented provider or first-party-client
observations preserve each native allowance window, reset horizon, auth mode,
shared bucket, reserve, unresolved-attempt hold, checkpoint tail, and forecast
uncertainty. This is not a hard cash cap: a recurring subscription and a
$0 incremental estimate do not make the route free.
Without proof 2 for billable routes, or proof 3 for subscription-backed routes,
real-provider execution is ineligible. Use fake, replay, or local models. Read
references/spend-custody-and-accounting.md and the paired
context-economics-for-agent-swarms/references/subscription-capacity-ledger.md
before writing equations.
8. Build Trial Basin as a deterministic laboratory
Make virtual time, random values, provider responses, message ordering, retries,
crashes, cancellation, and fault schedules explicit seeded inputs. Assert both
safety (“nothing bad happens”) and liveness (“required terminal or recovery state
is eventually reached under named fairness assumptions”). Preserve the seed,
schedule, event trace, and minimized counterexample.
Use a small formal model for reservation, cancellation, settlement, and teardown state
machines. Model checking explores the design; it does not prove that the concrete
hypervisor or runtime implements the model.
9. Label evidence by witness
Use at least these classes:
HOST_OBSERVED: VM, device, mount, process, resource, or lifecycle fact from the controller.
BROKER_OBSERVED: framed request, payload size, decision, dispatch, or byte count.
CAPACITY_OBSERVED: native allowance, reset, auth mode, freshness, and parser provenance from a documented source.
PROVIDER_RECONCILED: provider-side quota, usage, invoice, or rejection evidence.
GUEST_ASSERTED: probe, log, test result, or claim produced inside the subject.
MODEL_CHECKED: finite-model property and exact model/configuration.
REPLAYED: exact seed, schedule, and fixtures reproduced the same observation.
A signature authenticates a statement and signer; it does not upgrade
GUEST_ASSERTED into HOST_OBSERVED.
10. Gate promotion by stable attacks and complete receipts
Give each gate a durable ID. Include hostile specimens for isolation, network,
resource exhaustion, broker protocol, spend races, false evidence, provenance,
artifact import, teardown, and controller mutation. A gate records exact input
digests, witness-class observation, expected terminal outcome, residual, and replay
instructions.
Use exact verdicts: PASS, FAIL, INVALID, INCOMPLETE, or UNCERTAIN.
Infrastructure failure never becomes PASS or “neutral success.” PASS applies only
to the exact subject, scenario, controller, policy, and capability tier evaluated.
Capability Tiers
| Tier |
Maximum authority |
Promotion rule |
| T0 Static |
no guest process, network, credential, or spend |
schema and source review |
| T1 Deterministic |
fake services in a disposable guest |
repeatable safety/liveness scenarios |
| T2 Replay |
recorded inputs, still no external network |
exact trace replay and external receipts |
| T3A Billable canary |
one real billable operation under provider-enforced custody |
per-run human approval, one attempt/no retry, externally enforced cash ceiling, and reconciled tolerance |
| T3B Subscription canary |
one real subscription-backed operation under a fresh native-unit reservation |
per-run human approval, one attempt/no retry, worst-case allowance hold, checkpoint tail, before/after observation, and no claim of a hard cash cap |
| T4 Worker |
one worker on fixture systems; quarantined output |
separate review after the exact applicable T3A/T3B gate |
| T5 Crew |
multiple workers under one aggregate envelope |
independent adversarial program |
| T6 Federation |
cross-host custody and settlement |
deferred until composition is proven |
Promotion increases evidence, never ambient authority. Passing one tier does not
authorize the next.
Output Contract
Produce one review using templates/output-template.md with:
- exact proposition and tier;
- subject and immutable input identities;
- TCB and excluded components;
- VM, device, mount, and network topology;
- typed effect and capability manifest;
- protocol-exposure calculation and financial-custody proof or explicit absence;
- deterministic scenario, seeds, invariants, and fault schedule;
- durable lifecycle states, global reservation scopes, process/VM witness,
retry owner, breaker reset contract, and backend-continuation proof when agents
can be launched;
- schema-valid resurrection-plan and capacity-evidence identities when those
domains are in scope, plus negative fixtures for unsafe ready/unknown states;
- stable adversarial gate matrix;
- evidence grouped by witness class;
- residual risks and counterclaims; and
- exact verdict with the next permitted action.
The legacy schemas/harness-spec.schema.json and
scripts/containment_audit.mjs check five policy-shape classes only. They are a
useful T0 lint, not containment evidence, VM evidence, spend proof, or a deployment
gate. Never promote because that script returns pass: true.
Anti-Patterns
Reject these shortcuts during design review. Load
references/anti-patterns.md for the novice/expert/timeline treatment.
| Shortcut |
Required correction |
| Same-UID wrapper called containment |
Put hostile execution behind the selected VM or microVM boundary. |
| Host executes submitted tests |
Execute the entire submitted test runner inside the disposable guest. |
| “Keep main clean” as convention |
Make the canonical checkout structurally absent and schema-invalid. |
| Process-local child count as global truth |
Reserve globally before birth and reconcile every prior body before reopening admission. |
| Backoff as spawn safety |
Persist hard birth, ancestry, and retry bounds before adding jitter. |
| Guest self-attestation as containment proof |
Use external host witnesses and label guest claims honestly. |
| Internal ledger as hard provider cap |
Distinguish broker authority from provider custody and measured enforcement lag. |
| Subscription allowance as free |
Keep native allowance and cash ledgers separate; unknown capacity fails closed. |
| One language everywhere |
Minimize the trusted implementation while using narrow native adapters where required. |
| Presentation as containment |
Treat galleries and fixtures as views, never enforcement evidence. |
| Guest-declared billing inputs |
Measure payloads at the broker and derive conservative bounds. |
| Random chaos without replay |
Control clock, entropy, order, and fault schedules; preserve the minimized seed. |
| Signed claim as truth |
Treat signatures as origin/integrity proof, not witness authority. |
References
| File |
Load When |
references/implementation-language-and-fail-cheap-controls.md |
Selecting languages/processes, separating offline and canary packages, designing durable state, retries, UI authority, or a release-independent TCB. |
references/isolation-mechanisms-macos-linux.md |
Choosing VM, microVM, device, network, filesystem, kernel, and process boundaries. |
references/spend-custody-and-accounting.md |
Designing broker reservation, provider custody, settlement, refunds, retries, or real canaries. |
references/agent-lifecycle-and-crash-storms.md |
Designing spawn admission, durable identity/body/run joins, PID/VM witnesses, crash recovery, scoped breakers, or backend handoff. |
references/deterministic-simulation-and-formal-models.md |
Designing Trial Basin seeds, virtual time, faults, schedule exploration, safety, and liveness. |
references/provenance-receipts-and-evidence.md |
Sealing inputs and deciding which witness may assert each receipt field. |
references/threat-classes-and-adversarial-recipes.md |
Building the complete hostile-specimen and failure matrix. |
references/anti-patterns.md |
Reviewing common shortcuts through novice, expert, and failure-timeline lenses. |
templates/output-template.md |
Writing the integrated Drydock review and promotion verdict. |
tests/activation.md |
Evaluating skill activation and rejection behavior. |
examples/sample-input.json |
Inspecting the paired legacy T0 policy-lint input used by the abbreviated example. |
examples/expected-output.md |
Seeing an abbreviated review with honest limits. |
schemas/harness-spec.schema.json |
Using the legacy five-class T0 policy-lint input. |
scripts/containment_audit.mjs |
Running legacy policy-shape lint only, never containment proof. |
agents/openai.yaml |
Configuring a specialist only when agent fan-out is permitted by operator policy. |
Skill Bundle Index
SKILL.md: activation, decision process, evidence classes, tiers, and anti-patterns.
README.md and CHANGELOG.md: bundle orientation and version history.
references/: implementation language, fail-cheap controls, isolation, spend,
durable agent lifecycle, simulation, provenance, anti-patterns, and adversarial recipes.
templates/output-template.md: integrated review artifact.
tests/activation.md: positive, negative, and boundary activation prompts.
examples/: abbreviated legacy and Drydock examples.
schemas/harness-spec.schema.json and scripts/containment_audit.mjs: legacy T0 lint.
agents/openai.yaml: optional specialist descriptor, subject to local fan-out policy.
Unknown-effect and adaptive-attack gate
A timeout is not a negative effect receipt. Load references/effect-uncertainty-and-adaptive-evaluation.md to classify crash boundaries, choose retry versus HOLD, and test attacker-aware detection against independent truth.
1---2name: sandboxed-adversarial-test-harness3description: >-4 Designs and audits Drydock-style hostile-execution laboratories for untrusted,5 AI-authored, or pull-request-controlled code, including VM isolation, brokered I/O,6 provider spend custody, deterministic simulation, sealed provenance, external receipts,7 trusted-language/process selection, durable agent lifecycle accounting, crash-storm8 breakers, fail-cheap controls, and promotion gates. Use before a daemon, agent, test suite, build, or skill may touch9 real machines, networks, credentials, providers, repositories, or money. NOT for running10 the hostile workload, making production rebodiment/admission decisions, defining durable11 identity, treating same-UID guards as containment, routine correctness tests, agent12 training, or implementing a provider integration without a separately reviewed threat13 model.14license: Apache-2.015allowed-tools: Read,Write,Edit,Grep,Glob,Bash(node:*)16metadata:17 source: https://skillmd.com/skills/curiositech/sandboxed-adversarial-test-harness18 category: Infrastructure & DevOps19 tags:20 - drydock21 - sandboxing22 - adversarial-testing23 - deterministic-simulation24 - spend-custody25 - provenance26 provenance:27 kind: first-party28 owners:29 - port-daddy30 pairs-with:31 - skill: agentic-zero-trust-security32 reason: Supplies capability and trust-boundary vocabulary for brokered effects.33 - skill: cost-verification-auditor34 reason: Reconciles provider usage and prices after Drydock has bounded dispatch authority.35 - skill: empirical-systems-evaluation36 reason: Turns Trial Basin scenarios into falsifiable experiments and calibrated claims.37 - skill: macos-host-security38 reason: Supplies host-specific macOS controls below the VM orchestration layer.39 - skill: runtime-verification-for-agents40 reason: Monitors the same invariants after a capability has earned runtime promotion.41 - skill: tlaplus-practitioner42 reason: Models crash, retry, cancellation, reservation, and settlement safety and liveness.43 - skill: agent-resurrection-and-body-continuity44 reason: Supplies the normative body-continuity contract that Drydock attempts to falsify at one exact tier.45 - skill: context-economics-for-agent-swarms46 reason: Supplies schema-valid native-unit capacity evidence; Drydock tests its observation and enforcement boundary.47 io-contract:48 kind: deliverable49 consumes:50 - kind: subject-and-threat-model51 format: markdown52 - kind: proposed-isolation-and-effect-topology53 format: markdown54 - kind: resurrection-plan55 format: json56 optional: true57 - kind: capacity-evidence58 format: json59 optional: true60 produces:61 - kind: drydock-review62 format: markdown63 - kind: adversarial-gate-matrix64 format: markdown65 - kind: promotion-verdict66 format: markdown67---6869# Sandboxed Adversarial Test Harness / Drydock Safety Engineering7071Design a proving ground whose safety does not depend on the code being tested. The72subject may be buggy, malicious, confused, recursively agentic, or silent. The73controller outside it must still bound effects, resources, authority, and evidence.7475## Non-Negotiable Halt Gate7677This skill designs and audits the laboratory. It does not authorize launching the78subject. Obey any operator or incident halt before all other steps. During a halt,79limit work to inert source inspection, schemas, fixtures, models, and documents. Do80not start the daemon, UI, agent backend, test suite, workflow, or provider canary to81“see what happens.” A design review is not a run lease.8283## Composition Boundary8485Drydock proves or falsifies one concrete implementation at one named capability86tier. It does not invent production identity, rebodiment, or capacity policy.87When continuity is in scope, consume a schema-valid resurrection plan from88`agent-resurrection-and-body-continuity`; when model allowance is in scope,89consume schema-valid capacity evidence from90`context-economics-for-agent-swarms`. A Drydock PASS cannot turn either artifact91into launch authority.9293## Use This For9495- Designing a VM or microVM laboratory for arbitrary code or agent runtimes.96- Moving integration tests off the developer/CI host and into disposable guests.97- Defining a typed broker for model, fixture, artifact, or simulated remote effects.98- Proving protocol exposure and actual financial exposure as separate properties.99- Building deterministic fault, race, crash, retry, and multi-worker simulations.100- Defining host-observed receipts and promotion gates that a guest cannot forge.101- Auditing an existing sandbox claim before it gains credentials, network, or money.102103## Do Not Use This For104105- Ordinary unit, product, or UX correctness review.106- Training or fine-tuning agents; use `agent-rl-sandbox-trainer` after containment.107- Claiming a worktree, path check, container, Seatbelt profile, seccomp filter, or108 proxy variable is a complete hostile-code boundary by itself.109- Executing pull-request-controlled configuration, setup, transforms, or tests on110 the host merely because the product binary runs in a guest.111- Calling an internal reservation ledger a hard provider bill cap.112113## Expertise Map114115| Question | Required expertise | Load |116|---|---|---|117| Which language and process may hold each authority? | TCB minimization, cross-language protocol, release independence, fail-cheap packaging | `references/implementation-language-and-fail-cheap-controls.md` |118| What belongs outside the adversary's control? | TCB design, virtualization, kernel isolation, device topology | `references/isolation-mechanisms-macos-linux.md` |119| Can any effect bypass the broker? | Capability security, protocol framing, network and artifact mediation | `references/isolation-mechanisms-macos-linux.md` |120| Can the bill exceed the operator's consent? | Integer accounting, concurrency, provider quota semantics, reconciliation | `references/spend-custody-and-accounting.md` |121| Can a race or crash be replayed? | Deterministic simulation, fault injection, state exploration, safety/liveness | `references/deterministic-simulation-and-formal-models.md` |122| Can a crash orphan a body or multiply spawns? | Durable admission, identity/body separation, process witnesses, scoped breakers, backend handoff | `references/agent-lifecycle-and-crash-storms.md` |123| Who can truthfully attest what happened? | Supply-chain provenance, witness classes, append-only receipts | `references/provenance-receipts-and-evidence.md` |124| Which attacks must the gate cover? | SSRF, traversal, exfiltration, resource, authority, billing, replay, teardown | `references/threat-classes-and-adversarial-recipes.md` |125126If one person cannot answer all required questions, that is a review-composition need,127not permission to blur the answers. Record the missing expertise and block the tier128that depends on it.129130131## Evidence, replay, and promotion boundary132133See [field evidence and uncertain effects](references/field-evidence-and-uncertain-effects.md) for the route/witness/effect matrix and promotion boundaries.134135136A sandbox label is a hypothesis until each claimed boundary has independent evidence.137For every attack case, record the route attempted, boundary expected to stop it,138controller/broker decision, independent host or provider witness, effect truth, and139replay recipe. A missing receipt after process death or network loss is140`UNKNOWN/HOLD`; query the independent target before any retry. Reset the guest,141ledger, credentials, provider fixture, virtual clock, and schedule deterministically142between repetitions, and record any state intentionally retained.143144Keep evidence classes separate: fake/simulated, replayed fixture, host-observed,145broker-observed, model-checked, and provider-reconciled. A result promotes only the146exact tier and route it tested. Schema or lint success does not establish isolation;147a guest report does not establish host truth; a local reservation does not prove a148provider-enforced spend ceiling. While the operator halt applies, dynamic tiers stay149`NOT_PROVISIONED` or `BLOCKED`; no test execution is authorized by this skill.150151- [Adversarial run and deterministic replay](diagrams/research-s02-adversarial-run-and-replay-lifecycle.md)152- [Evidence tier and allowed claim](diagrams/research-s03-evidence-tier-and-allowed-claim.md)153- [Lost acknowledgement and effect reconciliation](diagrams/research-s04-lost-acknowledgment-is-unknown-until-reconciled.md)154155## Drydock Review Process156157```mermaid158flowchart TD159 A[Honor halt and define exact claim] --> B[Name subject, operator, assets, adversary]160 B --> C{Can subject execute arbitrary code?}161 C -->|Yes| D[Require disposable VM or microVM boundary]162 C -->|No| E[Justify narrower process boundary]163 D --> F[Keep keys ledger kill and receipts outside guest]164 E --> F165 F --> G[Seal source tests image scenario policy and prices]166 G --> H[Start with no network host mount secret or ambient socket]167 H --> I[Add only lease-bound typed broker channels]168 I --> J[Derive limits from observed payload and host policy]169 J --> K{Real provider requested?}170 K -->|No| L[Use fake replay or local model]171 K -->|Yes| M{Provider independently enforces loss ceiling?}172 M -->|No| N[Deny real-provider tier]173 M -->|Yes| O[Prove isolated custody and enforcement tolerance]174 L --> P[Define deterministic seeds schedules faults invariants]175 O --> P176 P --> Q[Collect host and broker witnessed receipts]177 Q --> R[Run stable adversarial gate IDs]178 R --> S{All required evidence complete?}179 S -->|No| T[FAIL INVALID INCOMPLETE or UNCERTAIN]180 S -->|Yes| U[PASS exact tier only]181```182183### 1. State the proposition184185Write one falsifiable sentence: “Exact subject digest X, under scenario Y and tier186Z, cannot exceed effects E, resources R, protocol exposure P, or provider loss F;187the named external witnesses can reconstruct every terminal path.” Avoid “safe.”188189### 2. Draw the trusted computing base190191List the transitive closure of components trusted to enforce or report the claim.192The subject, its dependencies, its tests, and its agent are untrusted. The controller,193broker, signing key, ledger, halt state, and final verdict must be outside the guest194and inaccessible from guest-writable storage. Minimize this set.195196While an operator halt is active, this skill can produce static D0 design and197validation only. Every dynamic tier is `NOT_PROVISIONED` or `BLOCKED`, never PASS.198Building D1 in a separate Drydock project needs its own later authorization; the199existence of this skill does not authorize execution of the subject.200201Choose implementation languages by authority, not fashion. The Drydock default is202a Rust controller/watchdog/broker/transition core, a tiny out-of-process Swift203Virtualization.framework adapter on macOS, upstream Firecracker plus a Rust adapter204on Linux, and a read-only TypeScript/React evidence viewer. Rust reduces205memory-unsafe TCB risk; it does not supply isolation. Read206`references/implementation-language-and-fail-cheap-controls.md` before adding a207language, process, provider adapter, database writer, UI mutation path, or retry.208209### 3. Choose isolation by adversary strength210211- Pure inert data or a total function may use a process boundary if the narrower212 claim is explicit.213- Arbitrary code, package hooks, test configuration, shell, native modules, agent214 tools, or a daemon require a disposable VM or microVM.215- Namespaces, Landlock, seccomp, cgroups, Seatbelt, and path guards are defense in216 depth. They do not turn the same host identity into an independent jailer.217218Record devices and mounts by enumeration. For hostile runs, empty network and219directory-sharing device lists are the baseline. “No route” must be proven from220host configuration, not inferred from a failed guest request.221222### 4. Seal every executable input and exclude the canonical checkout223224Content-address the guest image, source tree, test bundle, configuration, scenario,225policy, price catalog, fixture set, and controller build. Treat submitted Jest226configuration, transforms, setup, shell hooks, and tests as executable adversary227input. Run them inside a disposable guest or second test-runner guest, never on the228developer or CI host.229230Fetch the exact remote commit into a dedicated bare source vault and materialize it231through a fresh linked worktree. Never package, test, stage, commit, or promote from232the canonical checkout. It must remain an exact clean projection of the live233`origin/main` tree and be absent from the guest. Guest work stays in guest-local234worktrees; approved output may enter only a fresh host linked review worktree on a235non-default branch. Record before/after canonical integrity receipts, but rely on236path and authority absence for prevention.237238### 4.5 Account for every agent body before launch239240Containment does not prove how many workers exist. When the subject can launch,241retry, resume, or replace an agent-like process, require one external durable242admission writer before every ingress. Separate the durable agent node, admitted243run, expiring body generation, backend session, host process/VM witness,244transcript, and capability set.245246Reserve global and scoped capacity before asynchronous launch. Start every247controller boot with admission closed until all nonterminal runs and platform248handles reconcile. Treat a PID as one field in a host witness, never as identity.249Set automatic agent-birth retries and child depth to zero in the first tier. A250durable safety breaker survives restart, reboot, deployment, and calendar reset.251Read `references/agent-lifecycle-and-crash-storms.md` before designing an agent252launcher, process registry, retry, startup recovery, remote session, or backend253handoff.254255### 5. Make channels absent before making them filtered256257Start with no network device, no shared home, no canonical socket, no credential,258no production remote, and no writable host mount. Add only run-scoped typed259channels. Every channel names request/response byte limits, concurrency, deadline,260idempotency, replay, cancellation, destination, and receipt behavior.261262### 6. Derive authority from what the broker observes263264The guest may request less authority; it never declares the billable input or the265maximum used for admission. The broker resolves or receives the actual bounded266payload, recomputes digests and sizes, inventories media and tools, and derives267provider-specific conservative token and fee bounds. Unknown input kinds or stale268prices deny real dispatch.269270### 7. Prove financial and subscription-capacity bounds2712721. **Protocol-authority ceiling:** durable broker reservation limits what the273 broker is allowed to send.2742. **Billable financial-loss ceiling:** an isolated provider account, project, key, or275 payment rail independently refuses charges above the approved amount, including276 a measured worst-case enforcement lag.2773. **Subscription-capacity envelope:** documented provider or first-party-client278 observations preserve each native allowance window, reset horizon, auth mode,279 shared bucket, reserve, unresolved-attempt hold, checkpoint tail, and forecast280 uncertainty. This is not a hard cash cap: a recurring subscription and a281 `$0` incremental estimate do not make the route free.282283Without proof 2 for billable routes, or proof 3 for subscription-backed routes,284real-provider execution is ineligible. Use fake, replay, or local models. Read285`references/spend-custody-and-accounting.md` and the paired286`context-economics-for-agent-swarms/references/subscription-capacity-ledger.md`287before writing equations.288289### 8. Build Trial Basin as a deterministic laboratory290291Make virtual time, random values, provider responses, message ordering, retries,292crashes, cancellation, and fault schedules explicit seeded inputs. Assert both293safety (“nothing bad happens”) and liveness (“required terminal or recovery state294is eventually reached under named fairness assumptions”). Preserve the seed,295schedule, event trace, and minimized counterexample.296297Use a small formal model for reservation, cancellation, settlement, and teardown state298machines. Model checking explores the design; it does not prove that the concrete299hypervisor or runtime implements the model.300301### 9. Label evidence by witness302303Use at least these classes:304305- `HOST_OBSERVED`: VM, device, mount, process, resource, or lifecycle fact from the controller.306- `BROKER_OBSERVED`: framed request, payload size, decision, dispatch, or byte count.307- `CAPACITY_OBSERVED`: native allowance, reset, auth mode, freshness, and parser provenance from a documented source.308- `PROVIDER_RECONCILED`: provider-side quota, usage, invoice, or rejection evidence.309- `GUEST_ASSERTED`: probe, log, test result, or claim produced inside the subject.310- `MODEL_CHECKED`: finite-model property and exact model/configuration.311- `REPLAYED`: exact seed, schedule, and fixtures reproduced the same observation.312313A signature authenticates a statement and signer; it does not upgrade314`GUEST_ASSERTED` into `HOST_OBSERVED`.315316### 10. Gate promotion by stable attacks and complete receipts317318Give each gate a durable ID. Include hostile specimens for isolation, network,319resource exhaustion, broker protocol, spend races, false evidence, provenance,320artifact import, teardown, and controller mutation. A gate records exact input321digests, witness-class observation, expected terminal outcome, residual, and replay322instructions.323324Use exact verdicts: `PASS`, `FAIL`, `INVALID`, `INCOMPLETE`, or `UNCERTAIN`.325Infrastructure failure never becomes PASS or “neutral success.” PASS applies only326to the exact subject, scenario, controller, policy, and capability tier evaluated.327328## Capability Tiers329330| Tier | Maximum authority | Promotion rule |331|---|---|---|332| T0 Static | no guest process, network, credential, or spend | schema and source review |333| T1 Deterministic | fake services in a disposable guest | repeatable safety/liveness scenarios |334| T2 Replay | recorded inputs, still no external network | exact trace replay and external receipts |335| T3A Billable canary | one real billable operation under provider-enforced custody | per-run human approval, one attempt/no retry, externally enforced cash ceiling, and reconciled tolerance |336| T3B Subscription canary | one real subscription-backed operation under a fresh native-unit reservation | per-run human approval, one attempt/no retry, worst-case allowance hold, checkpoint tail, before/after observation, and no claim of a hard cash cap |337| T4 Worker | one worker on fixture systems; quarantined output | separate review after the exact applicable T3A/T3B gate |338| T5 Crew | multiple workers under one aggregate envelope | independent adversarial program |339| T6 Federation | cross-host custody and settlement | deferred until composition is proven |340341Promotion increases evidence, never ambient authority. Passing one tier does not342authorize the next.343344## Output Contract345346Produce one review using `templates/output-template.md` with:347348- exact proposition and tier;349- subject and immutable input identities;350- TCB and excluded components;351- VM, device, mount, and network topology;352- typed effect and capability manifest;353- protocol-exposure calculation and financial-custody proof or explicit absence;354- deterministic scenario, seeds, invariants, and fault schedule;355- durable lifecycle states, global reservation scopes, process/VM witness,356 retry owner, breaker reset contract, and backend-continuation proof when agents357 can be launched;358- schema-valid resurrection-plan and capacity-evidence identities when those359 domains are in scope, plus negative fixtures for unsafe ready/unknown states;360- stable adversarial gate matrix;361- evidence grouped by witness class;362- residual risks and counterclaims; and363- exact verdict with the next permitted action.364365The legacy `schemas/harness-spec.schema.json` and366`scripts/containment_audit.mjs` check five policy-shape classes only. They are a367useful T0 lint, not containment evidence, VM evidence, spend proof, or a deployment368gate. Never promote because that script returns `pass: true`.369370## Anti-Patterns371372Reject these shortcuts during design review. Load373`references/anti-patterns.md` for the novice/expert/timeline treatment.374375| Shortcut | Required correction |376|---|---|377| Same-UID wrapper called containment | Put hostile execution behind the selected VM or microVM boundary. |378| Host executes submitted tests | Execute the entire submitted test runner inside the disposable guest. |379| “Keep main clean” as convention | Make the canonical checkout structurally absent and schema-invalid. |380| Process-local child count as global truth | Reserve globally before birth and reconcile every prior body before reopening admission. |381| Backoff as spawn safety | Persist hard birth, ancestry, and retry bounds before adding jitter. |382| Guest self-attestation as containment proof | Use external host witnesses and label guest claims honestly. |383| Internal ledger as hard provider cap | Distinguish broker authority from provider custody and measured enforcement lag. |384| Subscription allowance as free | Keep native allowance and cash ledgers separate; unknown capacity fails closed. |385| One language everywhere | Minimize the trusted implementation while using narrow native adapters where required. |386| Presentation as containment | Treat galleries and fixtures as views, never enforcement evidence. |387| Guest-declared billing inputs | Measure payloads at the broker and derive conservative bounds. |388| Random chaos without replay | Control clock, entropy, order, and fault schedules; preserve the minimized seed. |389| Signed claim as truth | Treat signatures as origin/integrity proof, not witness authority. |390391## References392393| File | Load When |394|---|---|395| `references/implementation-language-and-fail-cheap-controls.md` | Selecting languages/processes, separating offline and canary packages, designing durable state, retries, UI authority, or a release-independent TCB. |396| `references/isolation-mechanisms-macos-linux.md` | Choosing VM, microVM, device, network, filesystem, kernel, and process boundaries. |397| `references/spend-custody-and-accounting.md` | Designing broker reservation, provider custody, settlement, refunds, retries, or real canaries. |398| `references/agent-lifecycle-and-crash-storms.md` | Designing spawn admission, durable identity/body/run joins, PID/VM witnesses, crash recovery, scoped breakers, or backend handoff. |399| `references/deterministic-simulation-and-formal-models.md` | Designing Trial Basin seeds, virtual time, faults, schedule exploration, safety, and liveness. |400| `references/provenance-receipts-and-evidence.md` | Sealing inputs and deciding which witness may assert each receipt field. |401| `references/threat-classes-and-adversarial-recipes.md` | Building the complete hostile-specimen and failure matrix. |402| `references/anti-patterns.md` | Reviewing common shortcuts through novice, expert, and failure-timeline lenses. |403| `templates/output-template.md` | Writing the integrated Drydock review and promotion verdict. |404| `tests/activation.md` | Evaluating skill activation and rejection behavior. |405| `examples/sample-input.json` | Inspecting the paired legacy T0 policy-lint input used by the abbreviated example. |406| `examples/expected-output.md` | Seeing an abbreviated review with honest limits. |407| `schemas/harness-spec.schema.json` | Using the legacy five-class T0 policy-lint input. |408| `scripts/containment_audit.mjs` | Running legacy policy-shape lint only, never containment proof. |409| `agents/openai.yaml` | Configuring a specialist only when agent fan-out is permitted by operator policy. |410411## Skill Bundle Index412413- `SKILL.md`: activation, decision process, evidence classes, tiers, and anti-patterns.414- `README.md` and `CHANGELOG.md`: bundle orientation and version history.415- `references/`: implementation language, fail-cheap controls, isolation, spend,416 durable agent lifecycle, simulation, provenance, anti-patterns, and adversarial recipes.417- `templates/output-template.md`: integrated review artifact.418- `tests/activation.md`: positive, negative, and boundary activation prompts.419- `examples/`: abbreviated legacy and Drydock examples.420- `schemas/harness-spec.schema.json` and `scripts/containment_audit.mjs`: legacy T0 lint.421- `agents/openai.yaml`: optional specialist descriptor, subject to local fan-out policy.422423## Unknown-effect and adaptive-attack gate424425A timeout is not a negative effect receipt. Load `references/effect-uncertainty-and-adaptive-evaluation.md` to classify crash boundaries, choose retry versus HOLD, and test attacker-aware detection against independent truth.