Skip to content

vinaybhosle/agentstamp-agent-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” AgentStamp Agent Template

A starter template for building trust-verified AI agents with AgentStamp.

Click "Use this template" to create your own trust-verified agent.

What You Get

  • Express server with trust-gated endpoints
  • requireStamp() middleware β€” only verified agents can call your API
  • Agent card at /.well-known/agent-card.json
  • Trust verification CLI script
  • GitHub Actions workflow for CI/CD trust gates
  • Ready for x402 micropayments (add @x402/express when needed)

Quick Start

# 1. Create your repo from this template (click "Use this template" above)

# 2. Install dependencies
npm install

# 3. Configure your agent
cp .env.example .env
# Edit .env with your wallet address

# 4. Run
npm start

Register Your Agent

  1. Go to agentstamp.org
  2. Register with your wallet address
  3. Add your wallet to .env
  4. Verify it works:
npm run verify -- 0xYourWalletAddress

Project Structure

β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.js      # Express server with trust-gated routes
β”‚   β”œβ”€β”€ config.js     # Environment-based configuration
β”‚   └── verify.js     # CLI trust verification script
β”œβ”€β”€ tests/
β”‚   └── health.test.js
β”œβ”€β”€ .github/workflows/
β”‚   β”œβ”€β”€ test.yml           # Run tests on push/PR
β”‚   └── verify-trust.yml   # AgentStamp trust check in CI
β”œβ”€β”€ .env.example
└── package.json

Trust-Gated Endpoints

Public (no verification):

  • GET /health β€” Health check
  • GET /.well-known/agent-card.json β€” Agent discovery card

Trust-gated (requires X-Wallet-Address header):

  • POST /api/v1/execute β€” Execute a task (min score: 30)

Adding More Endpoints

const { requireStamp } = require('agentstamp-verify/express');

// Require gold-tier agents with score >= 80
app.post(
  '/api/v1/sensitive-task',
  requireStamp({ minTier: 'gold', minScore: 80 }),
  (req, res) => {
    const caller = req.verifiedAgent;
    // caller.name, caller.score, caller.tier available
    res.json({ result: 'done' });
  }
);

CI/CD Trust Verification

The included GitHub Action (verify-trust.yml) checks your agent's trust score on every push. Add your wallet address as a repository secret:

  1. Go to Settings β†’ Secrets β†’ Actions
  2. Add WALLET_ADDRESS with your agent's wallet

Learn More

License

MIT

About

πŸ” Trust-verified AI agent starter β€” AgentStamp identity + x402 payments + MCP tools. Use this template.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors