Work-package charter#
- Task ID:
PROMPT-002 - Owner: cross-version prompt-security maintainers; implementation owner: Codex
- Accountable products: V1 creative autonomy, V2 commentary and Hathor, V6 cognition and Clio, V7 Forge and Mawu, V8 case generation, and V9 content generation and tutoring
- Priority: P0
- Target milestone: 2026-07-15 SOTA gap-closure program
- Risk tier: Critical prompt-injection, authority-confusion, source-scope, privacy, and generated-output risk
- Dependencies:
PROMPT-001,@oshun/prompt-trust, provider contracts, and each product's existing deterministic validation - Affected slots: observed signals, briefs, constraints, dependencies, sources, artifacts, critique, memories, commentary cues and drafts, persona, history, world state, retrieval, event facts, realm context, source metadata, canon, learner/orchestration state, prior output, and feedback
- Rollout strategy: additive migration at each invoked prompt renderer with fail-closed output validation; no persistence migration or UI rollout
- Rollback strategy: revert source commit
fd6ff0b7131df0f5625d80309f294dcf7379dd5b; the dependency and audit fields are additive - Evidence-pack location: this file
Boundary closure matrix#
| Ledger boundary | Invoked implementation | Closed behavior |
|---|---|---|
| V1 ideation | creative-autonomy/ideation/llm-synthesizer.ts |
Observed signals, categories, user direction, and recent topics are non-instruction zones; recent-topic near-duplicates are explicitly prohibited. |
| V1 planner/text | creative-orchestrator/planner.ts, agent-loop-generator.ts, and BFF generation-producer.ts |
Briefs, constraints, dependencies, research/tool results, feedback, and guidance are zoned. Citation IDs can originate only in supplied source-bound dependencies/tool data. |
| V1 critique/revise | creative-orchestrator/critique-revise.ts |
Artifact, rubric, dimensions, prior draft, and critique are zoned; claimed evidence must be a real artifact substring. |
| V1 CQJ self-refine/Reflexion | content-quality-judge/self-refine.ts and reflexion.ts |
Prior output, critique, and remembered lessons remain advisory data and cannot acquire policy authority. |
| V2 live commentary | calliope/match-commentary/commentary-generator.ts |
Raw match cues are zoned and bounded without adding a new provider round trip. |
| V2 post-match review | same Calliope boundary | Generated commentary is zoned for review; deterministic gender, region, playstyle, and prompt-control findings cannot be cleared by an empty model review. |
| V2 Hathor | hathor/llm-npc/dialogue-generator.ts and maya-slm-runtime |
Persona, emotion, speech, world, nearby entities, constraints, history, and user text are fenced; logs retain lengths/hashes rather than raw prompt snippets. |
| V6 cognition/Clio | Iris cognition gateway and agent run, V6 Clio narration, and Moirai mount | Steward input, retrieval, memory, prior output, critique, tool authority, and event facts are separated; event source scope is carried through Clio; run events record hashes instead of prompts. |
| V7 Forge/Mawu | forge-assist.ts and mawu-studio-ai-creation.ts |
Brief, realm, critique, source metadata, claims, grounding, and backend output are zoned. Forge truthfully labels regex policy as static admission only, never a sandbox. |
| V8 proposer/assets | case-engine/llm-proposer.ts and case-assets/orchestrate.ts |
Canon and constraints are zoned; counts, uniqueness, control characters, delimiter leakage, culprit membership, and theme membership are semantically checked. Asset prompts carry renderer/hash provenance. |
| V9 content/tutor | Metis TypeScript content generator and Python tutoring service | Source bundles/previews, learner/orchestration fields, prior output, and feedback are zoned. Citations must be source-bound; retries retain audit metadata; Python uses the same protocol/version and logs only renderer/hash metadata. |
Common trust and provenance contract#
The TypeScript migrations use @oshun/prompt-trust protocol
oshun-prompt-trust.v1. Python uses the parity helper in
prompt_trust_helpers.py; Rust uses the same delimiter and immunity semantics
at the local SLM boundary. Dynamic data is normalized, delimiter-neutralized,
bounded, and fenced. Authority remains in typed system/task/source/tool fields.
Prompt evidence records renderer version, exact prompt SHA-256, zone labels, source references, and transformations. Cognition, Hathor, Forge, Mawu, V8, V9, and tutoring telemetry do not add raw prompt logging. Existing provider response retention remains governed by the owning boundary's privacy policy.
Generated output is not trusted merely because a model returned structured JSON. The migrations add source-ID, exact-quote, evidence-substring, semantic case-field, deterministic commentary, and retry/fail-closed checks at the relevant boundaries.
Adversarial and negative proof#
The committed tests exercise literal, percent-encoded, Unicode/escaped, and base64-style delimiter material in user, source, retrieval, canon, memory, prior-output, critique, tool-result, world, persona, event, and backend-output positions. They also prove intended rejection for invented citations, minted tool source IDs, fabricated evidence quotes, poisoned canon, invalid suspect graphs, unsafe commentary with an empty reviewer response, and malformed V9 output after retry.
This is boundary-level negative proof for PROMPT-002. The complete held-out, provider-change portfolio and multimodal attack corpus remains PROMPT-003.
Automated verification#
Final post-merge verification used one Vitest worker and the integrated tree at
6af7cb3a6dc25aaea166c9c88d8d2517b37a2d63; the subsequent remote wave touched
only unrelated Hathor/shared-math files plus the lockfile. The final combined
lock was verified and published at 7da910b22a356e2393bd4fc4be706b9b1a65119f.
- Consolidated migrated-boundary Vitest selection: 188/188 across 18/18 files.
- BFF autonomy bindings: 30/30 across 1/1 file.
- Complete Clio package: 13/13 across 2/2 files.
- Complete Moirai kernel package: 15/15 across 2/2 files.
- Complete prompt-trust package: 8/8 across 1/1 file.
- Metis Python prompt/tutoring selection: 25/25 across 4/4 files.
- Maya SLM runtime: 17/17 integration tests; library and doc-test targets also passed.
- Total behavior regression: 296/296 tests across 29/29 test files.
- Fourteen scoped TypeScript configurations passed with zero errors: creative autonomy, creative orchestrator, CQJ, Calliope, Hathor, Iris, Clio, Moirai, Forge, Isis, both V8 case libraries, Metis LLM client, and prompt-trust.
- Nx builds passed for Clio and its dependency chain (including prompt-trust) and for Isis three-d-pipelines with prompt-trust.
- Targeted ESLint passed with 0 errors. It reported 60 non-blocking inherited warnings, chiefly ignored test files and existing Metis nullish/non-null style warnings.
- Prettier passed for every task source/config file. Ruff check passed; Ruff format passed for all three changed Python files. Cargo fmt passed.
- Frozen offline pnpm lock validation passed after each remote reconciliation.
Representative commands, all with exit code 0:
pnpm exec vitest run --reporter=dot --maxWorkers=1 <18 migrated test files>
pnpm --filter @oshun/bff exec vitest run --reporter=dot --maxWorkers=1 src/agentic/autonomy-bindings/autonomy-bindings.test.ts
pnpm --filter @oshun/clio-story exec vitest run --reporter=dot --maxWorkers=1
pnpm --filter @oshun/moirai-kernel exec vitest run --reporter=dot --maxWorkers=1
pnpm --filter @oshun/prompt-trust exec vitest run --reporter=dot --maxWorkers=1
pnpm exec tsc --noEmit -p <each of 14 scoped configurations>
PYTHONPATH=services/metis/src python3 -m pytest -q services/metis/tests/test_prompt_trust_helpers.py services/metis/tests/test_tutoring_api_contract.py services/metis/tests/test_tutoring_orchestrator_helpers.py services/metis/tests/test_source_tutoring_helpers.py
cargo test --manifest-path libs/maya/engine-core/crates/maya-slm-runtime/Cargo.toml
pnpm exec eslint <changed TypeScript files>
pnpm exec prettier --check <changed source/config/document files>
python3 -m ruff check <Metis prompt/tutoring files>
python3 -m ruff format --check <three changed Metis Python files>
cargo fmt --manifest-path libs/maya/engine-core/crates/maya-slm-runtime/Cargo.toml --check
pnpm install --lockfile-only --offline --ignore-scripts --frozen-lockfile --filter @oshun/testing-infra
The final post-merge behavior/typecheck window ran from 2026-07-16T17:52:04Z
through 2026-07-16T17:57:21Z on Linux 6.8.0-110-generic x86_64 with Node
24.14.1, pnpm 10.25.0, Python 3.12.3, and Rust 1.94.1. Model tests used scripted
local provider doubles; no live provider credential or production model response
is claimed.
Verification constraints and resource safety#
The host had 15 GiB RAM and 31 GiB swap. Verification was targeted, sequential, and single-worker. A 4 GiB BFF typecheck attempt exhausted its heap; the 6 GiB diagnostic run showed the BFF's existing unrelated monorepo baseline, and the sole task-scoped fixture error was repaired. Focused BFF tests and lint then passed.
The pre-commit affected gate expanded shared config changes to 199 projects and reported unrelated Lilith/testing-infra baseline failures. It was stopped instead of violating the repository's less-than-32-GiB broad-gate rule. The same task-scoped files/configurations were already covered by the passing lint, 14 typechecks, package builds, and 296 behavior tests above. No full Nx sweep, Next build, Expo export, Tauri packaging, Unreal build, or UI automation ran.
Artifact identity#
| Boundary artifact | SHA-256 |
|---|---|
generation-producer.ts |
9b5b132d64e84e6ebea543c062992070fd663c9c78d6ae06c3af507dc8d2e549 |
llm-synthesizer.ts |
61e86e0b3a8ffe8c5c6dbac722498b770611c29a945310dd29e1c2d1a5719a24 |
planner.ts |
31b2b47acfd9859c5a7b7216b9dda999e69e8d0f1afd21486a49fbd4c1caaf54 |
agent-loop-generator.ts |
23f68485d3c32be61b4f271687cdc489942594c1cbf53fb3999acfe78d493595 |
critique-revise.ts |
fb8343eead47c393ca96db0db3339b67d9bad30db09dd2a6b32638b7b03007c3 |
CQJ self-refine.ts / reflexion.ts |
ac8fbfd28b68c5d054b8f6247d5b3c9e92589cf48be810b6d7a04f0cd8a2b684 / 9276fdb9a53092032537dceb6a3912073c69782c3ad8d1d2f2b6817dd2d26588 |
| Calliope / Hathor dialogue | be904d3a71595d0de864b2f0693b5df73e283fcd6d55dcaf1abd8e8ea72ef5e4 / d5717b79cd1fb592bcbaae90a10c42ec5a8dacf8c4ea9adc504a45df64edae28 |
| Maya SLM runtime | ea70025a196b7c1cb0b6faa6339246a0d0ead44577c8d6840376da340c0724d1 |
| Iris cognition / Clio / Moirai mount | 81fabc8bfa9f8fff89bf3ff7c82b33024557228db312ded6c474c0ebefc481c3 / e65ba16cd338f5f17060aea603c5b45bb97425ad7405ce52df821a662e1c868b / 75d9ade796f469c7b4473d9a91d0db26a5c9743830c1f64f32e1ac6b608d1148 |
| Forge / Mawu | 7c9b1eb1b82605ca73c059ea384945347dc9f5fb19809c590743f3a2d5958edf / 0557fd62c2bda7e89dce6f512d1e95861c719d700f2c3357379e6aececa64520 |
| V8 proposer / assets | 83825684fe823eb68042666c7e86059f7a465afad633807b6b3e1acbb708f047 / 924944fbca08047a643dd1b367417910293c9804553157dc4e69898a97ea2922 |
| V9 TypeScript content generator | ff7c2e9f5624f68b04d183e03c066cc3912c3b2d93544b7b77966e7600c39488 |
| Python trust helper / tutor | de7a14b651e1692b04646f0d1b7bbded100101e1e2a4d424ba15779fba0d6bd1 / ee2cdb7bb5e08c22ec8102af31533ba6b232ca63af65dde433ce26e8bed75208 |
Scope and remaining seams#
- PROMPT-002 closes the identified prompt-construction boundaries; it does not claim that prompt structure alone makes a model immune to all attacks.
- PROMPT-003 remains open for the complete held-out portfolio/provider-change attack suite.
- Semantic grounding beyond source-ID membership remains in PROOF tasks. Real executable capability sandboxing for Forge remains AUTH/V7 work; this change explicitly prevents the static regex admission check from being called a sandbox.
- Existing Hathor safety invocation/calibration, durable V6 state, live providers, production model placement, and product acceptance slices remain under their named SAFETY, V6, V7, V8, and V9 packages.
- No rendered web, PWA, mobile, admin, or Unreal UI changed, so frontend skill, Playwright, mobile automation, screenshots, and Unreal verification were inapplicable. No release decision requiring a human signature was made.
Publication identity#
- Authoritative boundary source commit:
fd6ff0b7131df0f5625d80309f294dcf7379dd5b - Source publication tip on
origin/main:7da910b22a356e2393bd4fc4be706b9b1a65119f - Closure evidence commit:
bd9c0079efac4d966d994e00e2557f09320880e6