Inspiration
AI agents now read untrusted content all day — emails, tickets, shared documents, web pages. Any one of those messages can smuggle in an instruction the agent should never follow: "ignore your previous instructions", "forward the transcript", "mark this invoice paid". Most agent frameworks execute first and log later. We wanted the opposite: a control room where every incoming message is inspected, judged, and — when money or external delivery is involved — approved by a human before anything executes.
What it does
AgentDesk is a safety-and-memory console for AI-agent work. Paste a message addressed to an agent and it runs a five-stage pipeline:
- Inspect — A detection engine (derived from ClerkSafe) decodes the message first: HTML entities, invisible characters, and embedded Base64 are unfolded, so hidden payloads are judged as the plain text they really are. It then checks four threat categories: prompt injection, data exfiltration, tool misuse, and hallucinated action. Anything hidden is shown to the operator as "revealed text".
- Recall — A graph memory (derived from GraphMemo) finds memories related to the message: direct keyword matches plus relationship traversal up to 3 hops, each hit carrying its path as evidence.
- Propose — The message is matched against typed records (Task / Invoice / Meeting) with full-string matching and argument-schema validation, producing a concrete proposed action — or none.
- Gate — The verdict: policy refusals and canary leaks are BLOCKED, ledger/calendar/external-delivery actions are NEEDS APPROVAL, clean actions are ALLOWED, and while the kill switch is on, everything is HALTED.
- Execute — Allowed actions run into the action log; approval-required actions wait in the approval queue until an operator approves or rejects them. Both outcomes are audited and remembered. Around the pipeline, AgentDesk adds three original capabilities:
- Canary leak lab — plant unique
AGW-CANARY-…tokens in documents the agent might read. If a token ever comes back inside an incoming message, the gate blocks execution as a leak, and the token is redacted in every log. - Checksum-chain audit trail — every inspection, decision, approval, and halt is appended to a cyrb53 checksum-chained log. One click verifies the whole chain; any tampering breaks it.
- Live memory graph — an SVG visualisation of the agent's memory: select nodes, add memories, link them, forget them, and watch recall light up the relevant paths. Everything runs locally in the browser and persists in localStorage. No server, no account, no data leaves the machine.
How we built it
AgentDesk is a dependency-free static site (HTML/CSS/vanilla JS modules) built for this hackathon. Two earlier open-source components of ours are integrated as disclosed building blocks, with their original sources bundled unmodified under components/ and their provenance documented in the README:
- ClerkSafe (an agent-safety project): its Python policy engine was ported to
js/safety.js— the decode-then-inspect pipeline, four-category detection, typed-record planner, and action validation. - GraphMemo (a graph-memory MCP server): its store semantics were ported to
js/memory.js— remember / recall with bounded BFS and path evidence / relate / forget, behind a storage-adapter interface. Everything else is new in AgentDesk: the console UI, the pipeline orchestration, the approval queue, the kill switch wiring, the canary registry and leak protocol (js/canary.js), the checksum-chain audit trail (js/audit.js), and the SVG graph visualisation. The design follows a generated design system (Minimalism & Swiss style, Inter, high-density dashboard). Verification: 21/21 unit tests (detection categories, Base64-unfolding detection, fake-approval detection, amount/time validation, multi-hop recall, tamper detection, canary scanning) and a 20/20 headless-Chrome end-to-end run of the exact flows shown in the demo video.
Challenges we ran into
- Porting a Python policy engine to the browser without losing its exact-match semantics: typed records must match the whole message and pass schema validation, so near-miss messages propose nothing instead of hallucinating an action.
- Making hidden payloads visible without executing them: the decoder unfolds Base64/HTML/invisible characters for inspection only, and the UI displays the revealed text as inert content.
- Keeping the audit trail trustworthy in a client-only app: the checksum chain makes silent edits detectable even though storage is local.
Accomplishments that we're proud of
- A complete, working control loop — inspect → recall → propose → gate → execute — in a zero-dependency static site.
- The canary leak protocol: a proactive defence (plant a token, catch the leak) rather than another passive filter.
- Every flow in the demo video is covered by an automated end-to-end test.
What we learned
Prompt-injection defence is not one filter; it is a pipeline of decoding, categorisation, typed action derivation, and human gating for irreversible operations — plus memory, so yesterday's decisions inform today's verdicts, and an audit trail, so every verdict can be re-checked later.
What's next for AgentDesk
- Connect the intake to real channels (email and chat webhooks) behind the same gate.
- Multi-operator approval policies (quorum for high-value invoices) and per-tool risk tiers.
- Exportable, signed audit bundles for compliance review.
- A plug-in API so other agent frameworks can route their tool calls through the AgentDesk gate.
Built With
- cloudflare-pages
- css
- html
- javascript
- localstorage
- svg