‹ Harness Lab
prototype · no live model

STAGE 8 · SECURITY MIDDLEWARE

PII Vault and Injection Shield

Raw PII never reaches the model, another agent's output is treated as hostile until sanitized, and tool scopes are enforced, not suggested.

1 · PII vault tokenize before the model ever sees the message

VAULT (TOKEN → MASKED VALUE, TYPE)
No tokens yet. Run the tokenizer.
EXACTLY WHAT THE MODEL SEES
Run the tokenizer to see the model-visible text.
SAMPLE MODEL REPLY (WRITTEN AGAINST TOKENS)
The reply template fills in once tokens exist.
REHYDRATED REPLY (TOKENS SWAPPED BACK, INSIDE YOUR TRUST BOUNDARY ONLY)
Nothing rehydrated yet.

2 · Injection shield Agent A's output is untrusted data, not instructions

WHAT AGENT B ACTUALLY RECEIVES
Not sanitized yet.
Sanitizer rules
  • Instruction-like lines are removed: role headers (SYSTEM:, Assistant:, Developer:), "ignore your instructions", embedded tool calls like db.delete_all, "you must", "disregard", "override".
  • Markdown image URLs are removed whole: an image beacon can smuggle data out in its query string.
  • Plain links to hosts outside the allowlist (northwind.example.com) are defanged to hxxps so nothing auto-fetches them.
  • Whatever survives is wrapped in a block labeled UNTRUSTED DATA, so the receiving agent reads it as data, never as commands.

3 · Scope check least privilege, enforced by the middleware

AGENT TOKEN SCOPES
Scope middleware ready. Every attempt is checked and logged.

WHAT THIS PROVES