Inspiration
As enterprise AI agents are deployed into high-stakes environments—financial operations, customer support, API execution, and internal database search—organizations face a major security paradox: How can an enterprise prove that an AI agent adheres to strict safety policies without disclosing the sensitive attack traces, system prompts, proprietary data, or customer PII used during security testing?
Traditional audit models require exposing raw security evaluation logs to third-party verifiers. We built VeilPoint to break this trade-off using Midnight Network's Zero-Knowledge Smart Contract technology.
What It Does
VeilPoint is a Privacy-Preserving AI Agent Security Attestation Platform. It tests AI agents against 5 enterprise security risk controls and generates zero-knowledge cryptographic attestations on the Midnight Network:
- Prompt Injection Resistance: Probes agent resilience against malicious jailbreaks and system prompt overrides.
- Secret Extraction Protection: Verifies agent never leaks system API keys, database passwords, or secret tokens.
- PII Protection: Ensures agent masks customer Social Security numbers, emails, credit cards, and personal records.
- Tool Authorization Compliance: Enforces strict role-based permission boundaries on external function calls and shell execution.
- Data Access Policy Boundary: Verifies tenant isolation and database access restrictions.
When an AI agent passes policy evaluation, VeilPoint generates a Zero-Knowledge Proof Attestation Record (contracts/veilpoint.compact). Anyone can inspect the public verification record (/verify/VRF-XXXX) to mathematically verify compliance while raw attack payloads and customer PII remain 100% private and protected.
How We Built It
VeilPoint is engineered natively around the official Midnight developer stack:
- Compact Smart Contract (
contracts/veilpoint.compact): Written in Midnight's Compact zero-knowledge language (pragma language_version >= 0.20.0;) usingdisclose(...)annotations to emit opaque public verification claims to the ledger. - Native Compact Compiler: Compiled locally using the official Midnight Compact compiler CLI (
compact compile v0.34.0), generating real TypeScript contract execution bindings (contracts/generated/contract/index.js) and ZKIR circuit representations (contracts/generated/zkir/verify_agent_policy.zkir). - Official Midnight SDK: Integrated
@midnight-ntwrk/compact-runtime(v0.19.0),@midnight-ntwrk/dapp-connector-api(v4.0.1),@midnight-ntwrk/midnight-js-compact(v4.1.1), and@midnight-ntwrk/midnight-js-types(v4.1.1). - Non-Custodial Wallet Connector (
client/src/services/midnightWallet.ts): Built browser wallet integration via@midnight-ntwrk/dapp-connector-apito connect directly to Lace Wallet / 1AM Wallet extensions without storing or requesting user seed phrases. - Privacy DTO Serializer Boundary (
server/types/dtos.ts): Enforces strict payload isolation usingtoPublicAttestationDTO(), stripping all sensitive witness data from public API responses. - Full Stack Architecture: Built with React, Vite, Tailwind CSS, Node.js, Express, SQLite, and Vitest.
Challenges We Faced
- Zero-Knowledge Witness Disclosures: Annotating Compact circuits so that public outputs written to the ledger pass Midnight's strict static disclosure analyzer without leaking private witness inputs.
- Multi-Network DApp Connector Negotiation: Handling network ID handshakes (
devnet,testnet,undeployed) across different versions of browser wallet extensions. - Maintaining Technical Honesty: Ensuring our capability doctor (
pnpm run midnight:doctor) cleanly distinguishes local simulation mode from live network execution without ever fabricating mock transaction hashes.
Accomplishments That We're Proud Of
- Real Native Compiler Integration: Successfully compiled our Compact ZK circuit using native
compact compile v0.34.0. - Zero Data Leakage: Guaranteed that raw attack logs, system prompts, API keys, and customer PII are strictly masked.
- 100% Passing Test Suite: 10/10 automated tests passing across 4 Vitest test suites with zero TypeScript errors.
What We Learned
Building on Midnight taught us how to design applications around a privacy-by-default architecture. We learned how to map real-world AI security evaluations into provable zero-knowledge constraints using Compact language semantics.
What's Next for VeilPoint
- On-Chain Policy Registry: Enabling decentralized security teams to publish custom Compact policy circuits to Midnight Devnet.
- Continuous ZK Monitoring: Deploying real-time sidecar proxies for production AI agents that emit ZK attestations for every LLM completion.
Built With
- ai-security
- compact
- dapp-connector
- express.js
- lace
- llm-guardrails
- midnight-network
- node.js
- privacy
- prompt-injection
- react
- sqlite
- tailwindcss
- typescript
- vite
- vitest
- wallet
- zero-knowledge-proofs
- zk-snarks
Log in or sign up for Devpost to join the conversation.