Submission for T3N Agent Build Challenge on Superteam Earn
An enterprise-grade, hardware-isolated governance and execution gate for autonomous AI agents on the Terminal 3 Network (T3N).
Modern enterprises deploying AI agents face critical security challenges: credential exposure, unconstrained egress, and the absence of a cryptographically verifiable audit trail.
The T3N Agent Governance Gate solves this by establishing a zero-trust execution boundary:
- Confidential TEE Execution: Business logic runs inside hardware enclaves compiled to WebAssembly (
wasm32-wasip2). - Zero-Knowledge Secret Storage: External credentials (API keys, bearer tokens) are seeded directly into the enclave's encrypted KV store and are never exposed to the agent LLM.
- Cryptographic Delegation: Data owners issue fine-grained, revocable member delegations defining allowed function names, versions, and egress network hosts.
- Decentralized Agent Identity: Agents operate with verifiable DIDs registered under organizational hierarchies on T3N.
| Entity | Identifier / Detail |
|---|---|
| Tenant / Owner DID | did:t3n:c72998d36d250ec2dfc741abc9f6d92b469c194d |
| Organization Name | GovernanceGateLabs |
| Organization DID | did:t3n:5f994a08ab705d1559250c9b3e89e3fe9eedec50 |
| Registered Agent Name | Governance Gate Agent |
| Agent DID | did:t3n:d099464a1e2fa3f7670622d3e722b81eef366f50 |
| Registered Contract ID | 983 (z:c72998d36d250ec2dfc741abc9f6d92b469c194d:flight-contracts) |
| Contract Version | 0.4.1 (WASM Component Model wasm32-wasip2) |
| Enclave KV Map | secrets (Hardware Enclave Protected) |
├── contract/ # Rust smart contract source compiled to wasm32-wasip2
│ ├── Cargo.toml # Manifest locking dependencies
│ ├── src/ # Implementation (lib.rs, booking.rs, search.rs)
│ └── wit/ # WebAssembly Interface Type (WIT) specifications
├── docs/ # Architecture diagrams & judging documentation
│ ├── ARCHITECTURE.md # Comprehensive system architecture & data flow
│ └── BUG_REPORT.md # 4 detailed bug reports discovered during development
├── scripts/ # TypeScript automation suite using @terminal3/t3n-sdk
│ ├── agent-e2e.ts # End-to-end delegation & stateless invocation
│ ├── invoke-test.ts # Tenant contract execution & verification
│ ├── ipv4-patch.mjs # Network reliability patch for dual-stack environments
│ ├── quickstart.ts # Handshake, manifest verification & authentication
│ ├── register-contract.ts # Automated WASM upload & contract registration
│ ├── seed-secrets.ts # Enclave KV map creation & secret seeding
│ └── package.json # Node.js dependencies
├── .env.example # Configuration template
└── README.md
- Node.js: v20+
- Rust:
1.80+with targetwasm32-wasip2 - wasm-tools:
cargo install wasm-tools
cd scripts
npm install
cp ../.env.example .env
# Fill in your T3N credentials claimed from https://www.terminal3.io/claim-pagecd ../contract
cargo build --target wasm32-wasip2 --release
wasm-tools component wit target/wasm32-wasip2/release/z_tenant_flight.wasm# Run native Rust unit tests and clippy
cargo test --lib --target x86_64-unknown-linux-gnu
cargo clippy --all-targets --target x86_64-unknown-linux-gnucd ../scripts
# Authenticate with T3N Testnet
npx tsx quickstart.ts
# Register WASM contract inside enclave
npx tsx register-contract.ts
# Seed secrets into enclave KV Map
npx tsx seed-secrets.ts
# Test delegation and invocation
npx tsx invoke-test.tsAs part of our commitment to improving the Terminal 3 Network developer ecosystem, we identified and documented 4 issues during development:
- Bug 1: Delegation schema omission in documentation (
scopesparameter). - Bug 2: Broken redirection on community ADK URL.
- Bug 3: Rust WASM target configuration breaking native test execution.
- Bug 4: SDK TLS connection timeout in dual-stack IPv6/IPv4 Linux/WSL environments.
Detailed reproduction steps, logs, and recommended resolutions can be reviewed in docs/BUG_REPORT.md.
This project is fully designed for continuous production use. Following the competition evaluation, we are open to either:
- Maintaining and extending the Governance Gate as an open-source community module for the T3N ecosystem.
- Formally handing over the repository and architecture to the Terminal 3 Network core team.
Apache License 2.0. See LICENSE for details.