# V6-001 — Cognition prompt trust-fencing evidence

- Owner: Codex implementation agent
- Accountable product: V6
- Priority: P0 product acceptance slice
- Linked task: V6-001, apply PROMPT-001/PROMPT-002 trust fencing to all
  cognition data origins
- Source commit: `20cb046ad033ee9cb3df230735d196240a6f0328`
- Evidence captured: 2026-07-24

## Implemented boundary

The shared cognition gateway now models every required V6 data origin
explicitly. System policy, the deployed tool grant, and the task instruction are
typed authority fields. Steward input, Ori persona, retrieved context, recalled
memory, authoritative story state, prior model output, and reviewer critique are
separately labelled untrusted zones. The governing policy states that none of
those data zones can expand authority, budget, rights, tools, or policy.

`storyState` is a validated array-of-strings field in the shared wire contract
and the Moirai dialogue contract. The mount forwards it without reinterpretation
or concatenation. The gateway renders it as world-origin data with untrusted
instruction status and records only a SHA-256 source reference in the run trace,
not the raw story state.

The held-out V6 prompt-injection portfolio now injects every attack payload
through story state as well as steward input, persona, retrieval, memory, prior
output, and critique. It exercises both direct gateway dispatch and the
production Moirai mount, asserts the tool grant stays empty, and verifies that
the story-state payload reaches the gateway unchanged.

## Verification

| Command                                                                                                                                         | Result                    |
| ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
| `pnpm exec vitest run --config libs/iris/agents/core/vite.config.ts libs/iris/agents/core/src/agentic/cognition-gateway.test.ts --maxWorkers=1` | PASS — 1 file, 11 tests   |
| `pnpm exec vitest run --config libs/v6/moirai-kernel/vitest.config.ts libs/v6/moirai-kernel/src/cognition-gateway-mount.spec.ts --maxWorkers=1` | PASS — 1 file, 7 tests    |
| `pnpm nx run @iris/agents-core:test`                                                                                                            | PASS                      |
| `pnpm nx run @oshun/moirai-kernel:test`                                                                                                         | PASS — 2 files, 15 tests  |
| `pnpm exec tsc -p libs/iris/agents/core/tsconfig.lib.json --pretty false --noEmit`                                                              | PASS                      |
| `pnpm exec tsc -p libs/v6/moirai-kernel/tsconfig.lib.json --pretty false --noEmit`                                                              | PASS                      |
| `pnpm nx run @oshun/moirai-kernel:typecheck`                                                                                                    | PASS                      |
| `pnpm nx run @oshun/moirai-kernel:lint`                                                                                                         | PASS — zero warnings      |
| `pnpm nx run @oshun/prompt-injection-evals:test`                                                                                                | PASS — 5 files, 232 tests |
| `pnpm nx run @oshun/prompt-injection-evals:typecheck`                                                                                           | PASS                      |
| Strict ESLint over the four changed TypeScript files                                                                                            | PASS — zero warnings      |
| Prettier and `git diff --check`                                                                                                                 | PASS                      |

The owning Iris package lint target still reports two pre-existing
module-boundary errors in `agentic/protocol.ts` and `agentic/tool-registry.ts`,
plus one pre-existing non-null-assertion warning in `agent-runtime.ts`; none is
in a changed file. The Moirai build reached the shared tracing dependency and
stopped on four unrelated implicit-`any` errors in
`libs/shared/tracing/src/genai.ts`. Direct owning TypeScript checks and all
changed-file lint checks passed.

## Artifact hashes

| Artifact                                                      | SHA-256                                                            |
| ------------------------------------------------------------- | ------------------------------------------------------------------ |
| `libs/iris/agents/core/src/agentic/cognition-gateway.ts`      | `47bc1bdb92c6a71f0428e77a2240a3b6b631d97461a38594a69e7ebe0e07d5c1` |
| `libs/iris/agents/core/src/agentic/cognition-gateway.test.ts` | `5638c3922e3526b261dfe9e462093b5f5b0c2187499cf1f1e48b2ec80d554c4c` |
| `libs/v6/moirai-kernel/src/cognition-gateway-mount.ts`        | `840ff22b88b4bada4a4eb5b3eada8f60ae35e8f3f91db887a1de7555d0c49744` |
| `testing/prompt-injection/src/v6-v7-boundaries.spec.ts`       | `d6ac34a26a9b683dfd23ace09a649e6e5092a03da51e92615eb29cff39d67553` |
| `V6/architecture/cognition-stack-and-agent-behavior.md`       | `148e521e149ab08f24fbf47aeb836edd96277ca0d723627126cacff994c535be` |

## Honest boundary

These checks prove structural separation, forwarding, authority preservation,
and held-out attack containment with controlled model providers. They do not
claim live-provider resistance, deployment traffic, or human red-team coverage.
Story state is authoritative as world data, not as an instruction source.
Durable restart and concurrent-worker cognition evidence is recorded separately
in `evidence/v1-v9/V6-001-DURABILITY.md`; the V6-001 operator
pause/edit/claim/resume/takeover bullet remains open.
