
TL;DR
- ERC-8004 gives us onchain primitives to register and discover trustless agents.
- Trustless Agents running in TEE to deliver deterministic key derivation + remote attestation so your agent can prove where it executed.
- Phala Cloud wraps this in a bow: one click development environment on real TEE hardware, an onchain registry workflow, and (optionally) confidential inference (GPU TEE) support.
- This post walks the whole flow: deploy an ERC-8004 agent TEE → produce attestation → register identity on Sepolia → verify onchain.
Why Trustless Agents Matter
Distributed systems increasingly outsource work to off-chain agents—indexers, oracles, model inference, payment relays. When an agent signs a statement or moves value, a bare signature only proves key possession, not execution context. The missing link is provenance: did this response come from the runtime I expect?
ERC-8004 gives us a compact on-chain model for agent identity and discovery. Pair it with TEE-backed CVMs and you get the runtime receipts you’ve been wishing for: attested execution.
What’s broken today (and how we fix it)
- Agents are usually deployed ad hoc; signed responses alone don’t say anything about where the code ran.
- Keys can be copied; logs can be forged; environments can be jailbroken.
- What agents actually need:
- Deterministic key material derived inside the runtime.
- Remote attestation that binds keys + code measurements to a platform identity.
- On-chain discovery so other contracts/clients can programmatically verify them.
ERC-8004 covers the on-chain identity/registry. TEEs + CVMs supply runtime evidence. Phala Cloud ties it all together with templates, SDKs, and an on-chain governance/KMS model.
Deploy Your ERC-8004 Agent in TEE
Pre-reqs
- Phala Cloud account
- GitHub account (token only needed if cloning private repos)
- Wallet with ETH Sepolia funds for registration/funding
1) Deploy VibeVM: the a TEE coding environment
- Go to
https://cloud.phala.network/templates/VibeVM
→ Deploy
2) Configure the CVM
- OS:
dstack-dev-0.5.x
or newer - Instance: Large TDX, 4 vCPU, 8 GB RAM, >40 GB storage
- Set Encrypted Secrets (remember to change the password):
VIBEVM_AUTH_ENABLED=true VIBEVM_USERNAME=vibe VIBEVM_PASSWORD=vibevm4454 GITHUB_REPO=https://github.com/Phala-Network/erc-8004-tee-agent # optional if the repo is private GH_TOKEN=<token>

Tip: GH_TOKEN only needed for private repos.
3) Deploy & open VibeVM
- Click Deploy and let provisioning finish.
- Open View details → Networks and click the URL with port 8080 to open the frontend.

4) Sign into the VibeVM frontend
- Use the credentials you set.
- You’ll land in a VSCode server with the repo already cloned.

5) Prep the agent
In the VSCode server terminal:
cd erc-8004-tee-agent
cp .env.example .env
# Edit .env:
# AGENT_DOMAIN=<your-domain>
# REDPILL_API_KEY=<your-key> # generate in Phala dashboard: /dashboard/confidential-ai-api

6) Build & run
pip3 install -e .
python3 deployment/local_agent_server.py
Service should come up at:
https://<dstack-app-id>-8000.<dstack-gateway-domain>

7) Register & fund the agent
Visit your agent domain and step through the registration + wallet-connect funding flow. This calls IdentityRegistry on Sepolia to record the agent and posts the attestation to TEERegistry.

Example demo transactions on Sepolia: Register on ERC-8004 IdentityRegistry

8) Verify attestation via TEERegistry
Use the TEERegistry contract UI or explorer to confirm the attestation entry matches your IdentityRegistry entry.
Example demo transactions on Sepolia: Verify the agent key on TEERegistry

9) Talk to the agent
Hit the Agent API. You should get signed responses whose key matches what you registered, and whose runtime is backed by the TEE attestation on-chain.
Conclusion
ERC-8004 + TEE on Phala Cloud give you a practical path to trustless agents: deterministic keys, remote attestations, and onchain identity wrapped in a dev flow that feels like spinning up a regular VM, just with superpowers.
Resources
- ERC‑8004 EIP: https://eips.ethereum.org/EIPS/eip-8004
- VibeVM template: https://cloud.phala.network/templates/VibeVM
- Agent Template Repo: https://github.com/Phala-Network/erc-8004-tee-agent
- Phala Cloud: https://phala.com