Cognivern Copilot: Governed Spend for Autonomous Agents
Inspiration
As AI agents evolve from simple chatbots into autonomous operators capable of managing real-world funds, a critical trust gap has emerged. Agents can inadvertently drain wallets, interact with malicious contracts, or execute transactions that violate organizational policies because they lack a governance layer capable of reasoning about financial risk.
We envisioned a future where agents don't just execute instructions—they understand accountability.
That vision led us to build Cognivern Copilot, a governed spend control plane we call SpendOS: a system that enables AI agents to evaluate policy, reputation, and risk before taking financial action.
What It Does
Cognivern Copilot is a Gemini 3-powered operational spend agent designed to govern how other AI agents use funds.
Every transaction follows a strict, non-negotiable workflow:
PLAN → EVIDENCE → PREVIEW → CONFIRM → EXECUTE → AUDIT
Key Capabilities
Memory & Reputation
- Queries MongoDB to determine whether a vendor is trusted.
- Uses historical interactions and reputation scores to inform decisions.
Policy Simulation
- Performs a "dry run" through the Cognivern API before any transaction.
- Verifies whether proposed spending complies with organizational policies.
Human-in-the-Loop Controls
- Requires explicit human approval for high-value or high-risk actions.
- Ensures agents remain accountable without sacrificing autonomy.
End-to-End Auditability
- Generates immutable decision records.
- Anchors decision hashes to MongoDB and on-chain ledgers (X Layer/Filecoin) for permanent accountability.
How We Built It
🧠 Brain
- Gemini 3 Pro (
gemini-3-pro-preview) - Orchestrated through Google Cloud Agent Builder
🗄️ Memory Layer
- MongoDB MCP Server (
@mongodb-js/mongodb-mcp-server) - Provides:
- Persistent memory
- Vendor reputation scoring
- Queryable execution ledgers
- Historical context for future decisions
⚖️ Governance Engine
- Custom TypeScript API
- Built with:
- Express
- Drizzle ORM
Responsible for evaluating complex spend policies and approval logic.
🔒 Privacy
- Integrated with Fhenix
- Uses Fully Homomorphic Encryption (FHE) for confidential policy evaluation without exposing sensitive data.
🔐 Security
- Ledger DMK hardware signing
- Secures high-value approvals and transaction authorization.
☁️ Infrastructure
- Hosted on Google Cloud
- Uses Agent Builder sidecars to manage MCP tooling and integrations.
Challenges We Ran Into
Tool Sequencing
Ensuring Gemini consistently invoked mongodb_vendor_reputation before cognivern_preview_spend required rigorous prompt engineering and carefully designed system instructions.
MCP Orchestration
Running the MongoDB MCP server as a cloud sidecar while maintaining secure connections to MongoDB Atlas introduced operational complexity around deployment and authentication.
Deterministic Auditing
Mapping natural-language intent into a deterministic decisionId that could be verified across both MongoDB and on-chain storage proved to be one of the most challenging aspects of the system.
Accomplishments We're Proud Of
We Built a Protocol, Not Just a Chatbot
Cognivern Copilot refuses to execute actions until it has gathered evidence, evaluated policies, and simulated outcomes.
MongoDB Became a Reasoning Tool
Rather than using MongoDB as a passive datastore, we transformed it into an active component of the agent's decision-making process. The agent can remember prior incidents, assess vendor trustworthiness, and adapt its risk profile over time.
Zero-Trust Agentic Spend
We demonstrated that an autonomous agent can authorize a transfer of 100 USDC with the same level of auditability and governance expected from traditional corporate financial systems.
What We Learned
Function Calling Is the New UI
The way agents interact with tools is becoming more important than the chat interface itself. Reliable orchestration is what turns language models into dependable systems.
Context Is King
Without long-term memory, agents become financial amnesiacs—repeating the same mistakes because they cannot learn from prior outcomes.
GCP Agent Builder Accelerates Production AI
Google Cloud Agent Builder dramatically reduced the time required to prototype and deploy sophisticated multi-tool agents, making production-grade AI operations far more accessible.
What's Next for Cognivern
🤝 Multi-Agent Swarms
Enable specialized agents—such as a Researcher, Approver, and Payer—to collaborate through a shared MongoDB memory layer.
📈 Predictive Governance
Leverage MongoDB time-series data to anticipate budget overruns before they occur, allowing organizations to intervene proactively rather than reactively.
🌐 Mainnet Expansion
Transition our X Layer and Fhenix integrations from testnet environments to mainnet infrastructure, bringing institutional-grade governance to agentic finance.
Closing Thoughts
As AI agents gain the ability to move money, trust can no longer be an afterthought.
Cognivern Copilot introduces governed autonomy to agentic finance—combining memory, policy enforcement, simulation, human oversight, and cryptographic auditability into a single operational layer.
Our goal is simple:
Build agents that don't just know how to act, but know when they should.
Built With
- fhenix-(fhe)
- gemini-3
- google-cloud-agent-builder
- ledger-dmk
- mongodb-atlas
- mongodb-mcp-server
- next.js
- node.js
- typescript
- x-layer
Log in or sign up for Devpost to join the conversation.