harness¶
Rules for working on dd_harness: the conductor, policy gate, input check, grounding linter,
source check, run store and provenance, the A2A way in and the test kit dd_harness.testing
(System and boundaries, README.md). The repository-wide
rules in the root AGENTS.md apply as well.
Governance code belongs here, and it is used by every way in (the app, the workbench, an A2A client). If you are writing governance, a test double or a storage backend in another package, stop and put it here. A database backend is a harness module whose driver is an optional extra, and it implements the project log, never the project rules (Storage).
Load-bearing things¶
- The harness stands on its own (System and boundaries).
src/importsdd_sdkand third-party libraries only, neverworkbench,dd_app, an agent orinspect_ai;tests/test_harness_boundary.pyenforces it. The harness has no configuration of its own: each path comes from aDD_*variable or the caller's default (the workbench's development defaults are inworkbench.config, the app's inapp/config/). If you find yourself computing a default from a harness module's__file__, stop. - Policy is in the profile, not the environment (Policy and identity).
A
DD_*variable names a path, an address or a credential; what a deployment allows comes from the institutional profile it names, whose version and digest every envelope records. A new policy choice is a profile key the gate enforces, added to the vocabulary in the spec and inworkbench/profiles/README.md, and refused at load until something enforces it. If you find yourself reading an allow, deny or approval rule from aDD_*variable, stop: a run could not say which rule it was held to. - The harness imports no agent. Agents are services reached through
RemoteAgent(dd_harness.remote), and a registry file lists their URLs. Tests may import agent packages to serve them in memory (dd_harness.testing.in_process), andsrc/must not. - An agent's spans come back over the wire.
RemoteAgent.callreturns them inReceived.spans, beside theAgentResult, never inside it; the conductor imports them into its trace before linting. G0 rejects a span outside theinvoke_agenttree or one carrying a conductor attribute. Do not filter imported spans by trace id; that would hide such spans from G0. - Only the conductor fills identifiers, timestamps, telemetry, grounding mode and input hash.
- Only the authentication boundary names the human (Policy and identity).
A transport asks its
Authenticatorand passesacting_fortoConductor.invoke. The conductor holds no default, and a delegated child acts for the grant's principal. The stub (OperatorAssertion) recordsassurance: asserted; do not describe that as authenticated. If you find yourself readingacting_forfrom a request body, sending it to an agent, or giving the conductor a default, stop. Tests act fordd_harness.testing.TEST_PRINCIPAL. - Only the conductor sets lineage.
parent_invocation_idanddelegationscome from a delegation grant the conductor issued;invokerefuses a request that carriesparent_invocation_id. An orchestrator delegates throughctx.delegate, never by calling an agent directly (Orchestration). - The linter applies the agent's declared mode.
retrieval: G1–G4.input_only: R1–R3.none: R1–R3 + N1.delegation: R1, D1–D3, G4 (Orchestration). G0 and E1 apply in every mode. A violation downgradessucceededtofailed. Do not weaken a rule to make a test pass; do not add a mode without changing the grounding spec. - The linter checks consistency, not retrieval (Evidence and grounding).
An agent's
retrievalspans are its own declarations.dd_harness.sourcesre-hashes cited records against the pinned copies in a sources file. An unresolved item is never counted as verified, and a source file is never read without itssha256pin. Do not describegrounding: passedas proof that an agent retrieved anything, except for atool:source. - A tool source is the conductor's record (Agents, Tools). A
persona reaches an MCP server only through
dd_harness.gateway, under a grant the conductor issues from the card'stoolsand the profile'stool_servers. Only the gateway fillstool_retrievals, and the linter grounds atool:source on those alone. If you find yourself letting an agent connect to a server, or counting an agent's own span for atool:source, stop.mcpis imported only indd_harness.gateway(anddd_harness.testing.tools), behind thegatewayextra. - The doubles' schema is generated. Edit
src/dd_harness/schema/doubles.yamland runuv run dd-gen-schema harness/src/dd_harness/schema/doubles.yaml. - Shared test doubles live in
dd_harness.testing, not in another package's tests, so that every way in and every agent can test against a conductor.