Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

T3N Enterprise Agent Governance Gate

T3N Testnet TEE Enclave License: Apache-2.0

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).


📌 Executive Summary

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:

  1. Confidential TEE Execution: Business logic runs inside hardware enclaves compiled to WebAssembly (wasm32-wasip2).
  2. 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.
  3. Cryptographic Delegation: Data owners issue fine-grained, revocable member delegations defining allowed function names, versions, and egress network hosts.
  4. Decentralized Agent Identity: Agents operate with verifiable DIDs registered under organizational hierarchies on T3N.

🏛️ Live Deployment on T3N Testnet

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)

📁 Repository Structure

├── 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

🚀 Quickstart & Reproduction Guide

Prerequisites

  • Node.js: v20+
  • Rust: 1.80+ with target wasm32-wasip2
  • wasm-tools: cargo install wasm-tools

1. Installation

cd scripts
npm install
cp ../.env.example .env
# Fill in your T3N credentials claimed from https://www.terminal3.io/claim-page

2. Building the Confidential WASM Component

cd ../contract
cargo build --target wasm32-wasip2 --release
wasm-tools component wit target/wasm32-wasip2/release/z_tenant_flight.wasm

3. Running Test Suite

# 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-gnu

4. Deploying & Testing on T3N Testnet

cd ../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.ts

🧪 Comprehensive Bug Report

As 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 (scopes parameter).
  • 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.


📄 Post-Challenge Maintenance & Handover

This project is fully designed for continuous production use. Following the competition evaluation, we are open to either:

  1. Maintaining and extending the Governance Gate as an open-source community module for the T3N ecosystem.
  2. Formally handing over the repository and architecture to the Terminal 3 Network core team.

📜 License

Apache License 2.0. See LICENSE for details.

About

Enterprise Agent Governance Gate on Terminal 3 Network (T3N) with TEE Confidential Computing

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages