# Countersign

- **Event:** [Agents in Context Toronto: a MongoDB Hackathon](https://cerebralvalley.ai/e/mongodb-toronto-hackathon)
- **When:** Sat, Nov 14 at 9:00 AM – 9:00 PM (EST)
- **Where:** Toronto, Canada
- **Team:** [Aryan K](https://cerebralvalley.ai/u/aryankk), [Fares Islam](https://cerebralvalley.ai/u/farez998)
- **GitHub:** https://github.com/AryanKansagara/countersign
- **Demo video:** https://youtu.be/jsmCpsSsCRE?si=RQGOG-zCqdY55tKd
- **Gallery:** https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery
- **Page:** https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/15

Countersign is an MCP server that sits between AI agents and MongoDB Atlas. Agents never write to the database directly. Every change becomes a proposal: Countersign checks who is asking (the agent and the person it acts for), validates the query, and dry-runs it to find the exact records it would touch. Routine changes are applied automatically. Risky ones (bulk updates, deletes, sensitive fields, refunds over a limit, or anything unlike past approved changes) wait in an approval inbox where a different person sees a before-and-after diff. Dangerous ones are blocked outright.

Applied changes run in a single Atlas transaction that re-checks every record's version, saves a copy of each document, and verifies only the declared fields changed. Any change can be undone in one click. Every decision goes into a SHA-256 hash-chained audit log that the service's own database user can only append to. An emergency stop cuts off every agent instantly, and planted canary records freeze a hijacked agent.

It works with Claude Code, Claude Desktop, claude.ai, Cursor, VS Code and ChatGPT using one key. People sign in with GitHub, and agent keys are requested, approved by someone else, and shown once.

We red-teamed it with 12 attacks (prompt injection, bulk delete, privilege escalation, writes hidden in reads, cross-tenant joins, approval tampering, replay, race conditions, ledger tampering). Against plain MongoDB access all 12 succeed. Through Countersign all 12 are blocked.

Live: https://countersign-production-d0c9345e.up.railway.app
Try it as an approver: https://countersign-production-d0c9345e.up.railway.app/app?demo=bob

## More from Agents in Context Toronto: a MongoDB Hackathon

- [Wilco ATC](https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/12)
- [ERS](https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/13)
- [Readback](https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/14)
- [PromptForge](https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/16)
- [Solo Yolo](https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/17)
- [Ontara](https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/18)

---

Markdown version of https://cerebralvalley.ai/e/mongodb-toronto-hackathon/hackathon/gallery/15. Site index for agents: https://cerebralvalley.ai/llms.txt · full text: https://cerebralvalley.ai/llms-full.txt
