Inspiration

While working with AI agents, one question kept coming back:

What if an AI needs to spend money to complete a task?

The obvious solution would be to give it access to a wallet—but that never felt right. I wanted to explore a different approach where AI could help manage tasks involving payments without ever having full control over a user's funds.

That's how MidPilot started.

The goal was simple: let AI be useful, while keeping privacy and user control at the center.

What it does:- MidPilot is a privacy-first AI financial copilot built on Midnight Network. Instead of giving AI your wallet, you give it a mission.

For example:

"Deploy my website with a budget of 50 NIGHT."

MidPilot understands the request, plans the steps, estimates the cost, and requests approval before carrying out any spending. The actual spending rules are protected by Midnight's confidential smart contracts, so the AI never has unrestricted access to your wallet.

How I built it

I built MidPilot using:

Midnight Network for confidential smart contracts Ollama + Qwen for local AI reasoning Node.js & TypeScript for the backend and CLI Wallet CLI/MCP for secure wallet interactions SQLite for audit logs and chat history

One design decision I cared about from the beginning was keeping AI reasoning completely separate from wallet permissions. The AI can make suggestions and plan actions, but it never owns the user's funds or private keys.

Challenges

The biggest challenge wasn't writing code,it was designing the right architecture. I spent a lot of time figuring out how to integrate AI, the wallet, and Midnight's confidential smart contracts and how they should work together without compromising security. There were also plenty of technical problems along the way, from integrating local AI models to run getting wallet communication working smoothly between local AI and wallet. Have to debug a lot of code last night..

What I learned

This project gave me a much better understanding of privacy-preserving applications and how AI agents can be designed responsibly.

I also learned a lot about Midnight's confidential execution model and how important it is to separate decision-making from authorization when building AI systems that interact with money.

What's next

MidPilot is still an MVP, but I think there's a lot more to build.

Some ideas I'm excited about include:

Supporting multiple AI agents Smarter budgeting and financial planning A web dashboard for managing policies Better integrations with external services More advanced confidential smart contracts on Midnight

Built With

Share this project:

Updates

Submission history