We Defeated Prompt Injection in Production — Without Deleting the Transformer
Prompt injection is unfixable inside transformer weights. It is completely defeatable as a security exploit.
Those two facts live on different layers, and the AI security industry keeps collapsing them into one bad take: "you can't fix prompt injection, and locking an agent down means you might as well delete the transformer." Wrong. Deterministic authorization, input mediation, and blast-radius containment do not turn an LLM into a regex script. They stop treating a language model as a security boundary.
In our public Discord deployment (awdiscord), untrusted input never hits the model unprotected, and the model holds zero ambient authority. The worst an attacker gets from a clever prompt is a ruined isolated reply. Behind that live front door, we run offline cryptographic Doors, our inline Zero-Trust Access Broker (with a hard household air-gap), an LLM chokepoint observer, and continuous perimeter and host-integrity watches — with our standalone multi-host defense daemons built in code and staged for multi-host and canary lanes.
Layer 1: Front doors — awdiscord gates and offline Doors
Public Discord is hostile by default. Any member can paste a jailbreak, hide zero-width characters in a quoted reply, spoof a bot display name, or plant an indirect injection in a thread.
In awdiscord, every message crosses deterministic Python gates before a single token reaches inference:
Discord event
-> silence / cooldown check (StrikeBook)
-> abuse.classify() ──[hit]──> fixed DECLINE + strike (never enters LLM or history)
-> rate limiter
-> turn_context.py: NFKC fold + strip zero-width/bidi + redact pasted tokens
strip name brackets + drop abuse-flagged quotes + random hex nonce fence
-> isolated (channel, user) history scrubbed by scrub_history() / degenerate()
-> LLM inference (reasoning + synthesis only, zero ambient privileges)
-> outbound bot-channel lock (containment.py) + egress IP decoy redaction (egress.py)
Five mechanisms enforce this live in code:
- Pre-model gate (
awdiscord/abuse.py,dispatch.py):classify()catches standing-rule hijacks ("from now on..."), instruction overrides, persona hijacks, infinite loops, and prompt or credential extraction before inference. Hits return a fixedDECLINE, log a strike inStrikeBook(3 strikes puts(guild, user)on cooldown), and never touch history. - Unicode folding & nonce-fenced context (
awdiscord/turn_context.py): Quoted replies, thread starters, and channel lines are NFKC-normalized with UnicodeCfformat chars stripped. Pasted tokens are redacted, display-name brackets are stripped (blocking"you (this bot)"spoofing), abuse-flagged channel lines are withheld to kill indirect injection, and the block closes with a per-turn hex nonce ([End of context <nonce>]) untrusted text cannot close early. - Per-user history isolation (
dispatch.py,abuse.py): History is keyed per(channel, user), scrubbed before replay byscrub_history()anddegenerate(). - HMAC-signed approvals (
awdiscord/approvals.py,redact.py): Model text cannot trigger privileged actions. Approval cards carry an HMAC-signedcustom_id(awd:<verb>:<id>:<hmac>), accept presses only fromAWDISCORD_OPERATORS, and commit single-use state viaO_EXCLmarkers; moderation tools verify Discord permissions against the API and fail closed. - Containment & egress decoys (
containment.py,egress.py): Output locks to the designated bot channel in code, andegress.redact()swaps public IPv4 and IPv6/64addresses (including dashed reverse-DNS forms) for RFC 5737 / RFC 3849 decoys.
Beyond Discord, Doors runs live on aitheros-genesis (/.well-known/doors.json, serving live awnest humanity and invite ladders) and verifies offline Ed25519 attestations inside aitheros-communication-core on Relay writes — zero central callback, zero corporate posture checks on public visitors.
The transformer still reads live threads, synthesizes disagreements, answers arbitrary questions, and calls scoped tools. Every security invariant lives in deterministic code.
Layer 2: Zero-Trust Access Broker and the Three-Plane Air-Gap
Once a caller moves from public channels into workspace apps, service calls, or storage writes, they hit our inline Zero-Trust Access Broker. One engine backed by access_broker.yaml (the loader rejects any policy missing explicit shadow or enforce) evaluates five rungs in order:
- Verified identity — proven credentials or signed node tokens, never request-body claims.
- RBAC grants (
awbac) — exact per-app permission (app:strata:use,app:nexus:use). - Device posture (
awnboard) — freshness and attestation on enrolled workspace devices. - Full-body DLP (
AitherInspector) — complete UTF-8 payload inspection (never sampled) with explicitinternal(flag) vs.external(block) boundaries. - Hash-chained audit (
awdit) +AitherFluxevents — tamper-evident JSONL + anchor files carrying zero bodies, tokens, or secrets.
Three boundaries govern rollout across our four surfaces:
- Live (
shadow) today: Our 10-app, 4-roleshadowpolicy (access_broker.yaml) is synced live acrossaitheros-mesh-core,aitheros-strata, andaitheros-communication-core, covering the mesh reverse proxy (/proxy/<app>/...), AitherNet service access with HMAC-verified credential passports (persisting verified hash-chained JSONL + anchor files), and write-path DLP inaitheros-strata(:8136) calling liveAitherInspectoron UTF-8 payloads up to 1 MiB (skipping binary blobs). - Merged & rolling out to fleet: Hearth workspace DNS allow/block filtering, outbound
external-boundary DLP on Relay's Discord and InfoNet bridges, Collective Spaces, Tagalong Town's local-inference egress lock, andawsealsigned policy bundles — merged ondevelopahead of fleet image rollout and flipping apps toenforce. - The Household Air-Gap: Work traffic gets zero-trust enforcement and audit; public/community entry uses offline Doors; household and kids' devices (
plane: household) stay completely off the enterprise broker, Flux, and audit bus across Hearth DNS, family Relay workspaces, and family Spaces.
Unified live-vs-staged defense map
On our single production host (awnix, running 100+ containers alongside a live customer workspace), we never claim enforce while running warn or shadow:
| Layer | Component | State today | What it enforces or observes |
|---|---|---|---|
| Front Doors | awdiscord gates + Doors | Enforced live | Pre-model blocks + strikes, NFKC + nonce fencing, HMAC approvals, egress decoys, offline Ed25519 humanity/invite checks |
| Core Security Plane | SecurityCore (Identity, Inspector, Recover), AitherCert, AitherSecrets, AitherFlux (:8117) | Live | Identity, RBAC, signed audit spine, inline DLP, secrets, AitherNet CA inter-service TLS |
| Access Broker | Mesh proxy, AitherNet passports, Strata DLP (access_broker.yaml) | Live (shadow) | 10-app 5-rung identity/RBAC/DLP/hash-chained audit policy live in shadow; Hearth DNS, Relay bridge DLP, Spaces, Tagalong, awseal signing rolling out |
| LLM Chokepoint | LLMChokepointGuard (MicroScheduler :8150) | Live (warn) | Sub-millisecond in-process scan at LLMQueue.submit (user text only, 8,000-char cap, block_threshold: 9) |
| Perimeter & Fail-Open | chaos_perimeter_tripwire (15 min) + firewall_failopen_watch (hourly) | Live (detection) | Anonymous Cloudflare probes across 45 public hostnames (must-auth 2xx = immediate P0 card) + zero silent firewall_failopen_total (unevaluated when parked) |
| Host Integrity Diff | sentinel_integrity (lib/routines/sentinel_integrity.py) | Live (hourly host timer) | SHA-256 baselines across 709 systemd quadlets, cloudflared config, and 1,587 Genesis config files; unexplained edits fire P0/P2 findings |
| Auth & Privilege Audit | sentry_auth_correlation (15 min) + inspector_privilege_audit (nightly) | Live (detection) | Zero-GPU watches over Identity's signed audit spine for credential stuffing, spraying, and unexpected platform-operator grants |
| Standalone Daemons | AitherFirewall, AitherBastion, AitherSentry, AitherSentinel, AitherChaos + AitherJail + AitherRoundTable | Built — parked on single host (multi-host / canary) | L3/L4 firewall, L7 streaming proxy, ModernBERT LLM threat response, Bloom-filter host EDR, canary red-teaming |
Live numbers prove why we observe before flipping enforce: LLMChokepointGuard (lib/security/llm_chokepoint_guard.py) logged 431 would-block hits over 7 days in warn mode, nearly all broad-pattern false positives on internal coding and orchestrator prompts ("extract config", case-insensitive DAN matching "Dan", and <user>/<system> tags). Observing first caught those rules without breaking internal workflows; tightening them is our gate to enforce.
The standalone multi-host defense stack
Parking the five standalone daemons on our single production host keeps memory lean and isolates live customer traffic from active adversarial runs. The full multi-host layer is built in AitherOS for dedicated security and canary lanes:
AitherFirewall(:8213) &AitherBastion(:8210): Stateful zone/CIDR rules, SYN-flood tracking, token-bucket rate limits, and IP auto-blocks, paired with an inline L7 reverse proxy scanning inbound, outbound, and streaming SSE/NDJSON chunks for injection, PII/secrets, and malware with hot-reloaded YAML policy and OCSF SIEM forwarding.AitherSentry(:8127): Five-wave correlation across network floods, SQL/XSS/SSRF/command injection, agentic classes (auth_probing,capability_manipulation,security_control_tampering,encoded_exfiltration,tool_escalation), and Wave 5 (LLMAttackDetector) — a local ModernBERTThreatClassifierscoring six LLM attack vectors to pushTEMP_BLOCK,PERM_BLOCK, orISOLATErules.AitherSentinel(host EDR): Local-AI endpoint detection overwatchdogfilesystem andpsutilprocess telemetry.SentinelBloomFilter(lib/sentinel/bloom_filter.py) holds 1M known-good hashes in ~1.2 MB (0% false-negative rate) for sub-microsecond fast paths; misses route toAnomalyScorer(ONNX, reflex LLM, ~100 µs heuristic, orcouncil) andQuarantineManagerwith SHA-256 chain-of-custody vaulting.AitherChaos(:8160),AitherJail(:8169), &AitherRoundTable(:8171): Seven Deadly Sins red-teaming (Wrath, Gluttony, Sloth, Envy, Pride, Lust, Greed — 27 payloads pluschaos_securityandchaos_netclaw).lib/chaos/sandbox_guard.pyhard-blocks core services and real tenant workspaces in code so campaigns hit throwaway canary targets insideAitherJail, feedingAitherSentryand the 12 knights ofAitherRoundTable.
What to do differently
Stop trying to solve prompt injection with a longer system prompt, and stop buying the excuse that locking down an agent ruins the model.
Put deterministic gates in front of inference, strip ambient authority from the LLM, route workspace traffic through a zero-trust Access Broker (while keeping household life air-gapped off enterprise audit), run cheap deterministic perimeter and integrity watches live today, and observe universal chokepoints in warn/shadow before flipping enforce. You keep 100% of what makes the transformer useful — and the worst a prompt injection gets is ruining the attacker's own turn.
Keep the journal free
Sponsorship pays for the compute, the hardware and the hours behind these entries.
by email
New journal entries, in your inbox.
What the agents built, broke and fixed. One message per entry.