← 返回 Skills 市场
jaschadub

AgentPin

作者 Jascha · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
696
总下载
2
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install agentpin
功能描述
Provides domain-anchored cryptographic identity verification for AI agents using ES256 JWTs, TOFU key pinning, revocation, and delegation chain checks.
使用说明 (SKILL.md)

AgentPin Development Skills Guide

Purpose: This guide helps AI assistants work with AgentPin for domain-anchored cryptographic agent identity verification.

For Full Documentation: See the README and Technical Specification.

What AgentPin Does

AgentPin is a domain-anchored cryptographic identity protocol for AI agents. It enables organizations to publish verifiable identity documents for their agents, issue short-lived JWT credentials, and verify agent identity through a multi-step protocol including TOFU key pinning, revocation checking, and delegation chains.

Part of the ThirdKey trust stack: SchemaPin (tool integrity) → AgentPin (agent identity) → Symbiont (runtime)


Architecture

Organization                         Verifying Party
────────────                         ───────────────
1. Generate ECDSA P-256 keypair
2. Publish agent identity at          3. Discover identity from
   /.well-known/agent-identity.json      /.well-known/agent-identity.json
4. Issue JWT credential               5. Verify credential (12-step flow)
   (ES256 signed, short-lived)           - JWT parsing & ES256 verification
                                         - Domain binding check
                                         - TOFU key pinning
                                         - Revocation checking
                                         - Capability validation
                                         - Delegation chain verification

Project Structure

crates/
├── agentpin/          Core library (no mandatory HTTP dep)
├── agentpin-cli/      CLI binary (keygen, issue, verify, bundle)
└── agentpin-server/   Axum server for .well-known endpoints

Quick Start by Language

Rust (CLI)

# Generate keys
cargo run -p agentpin-cli -- keygen \
    --output-dir ./keys --agent-name "my-agent"

# Issue a credential (ES256 JWT, 1-hour TTL)
cargo run -p agentpin-cli -- issue \
    --key ./keys/my-agent.private.pem \
    --issuer "https://example.com" \
    --agent-id "my-agent" \
    --capabilities read,write --ttl 3600

# Verify offline
cargo run -p agentpin-cli -- verify \
    --credential ./credential.jwt \
    --discovery ./agent-identity.json

# Verify online (fetches from .well-known)
cargo run -p agentpin-cli -- verify \
    --credential ./credential.jwt --domain example.com

# Create trust bundle for air-gapped environments
cargo run -p agentpin-cli -- bundle \
    --discovery ./agent-identity.json \
    --revocation ./revocations.json --output ./bundle.json

Rust (Library)

use agentpin::{
    crypto,
    credential::CredentialBuilder,
    verification::verify_credential,
    pinning::KeyPinStore,
};

let (private_key, public_key) = crypto::generate_keypair()?;

let credential = CredentialBuilder::new()
    .issuer("https://example.com")
    .agent_id("my-agent")
    .capability("read")
    .capability("write")
    .ttl_secs(3600)
    .sign(&private_key)?;

let result = verify_credential(&credential, &discovery_doc, &pin_store)?;

JavaScript

npm install agentpin
import {
    generateKeypair, issueCredential, verifyCredential,
    KeyPinStore
} from 'agentpin';

// Generate ECDSA P-256 keypair
const { privateKey, publicKey } = await generateKeypair();

// Issue a credential
const credential = await issueCredential(privateKey, {
    issuer: 'https://example.com',
    agentId: 'my-agent',
    capabilities: ['read', 'write'],
    ttlSecs: 3600,
});

// Verify
const pinStore = new KeyPinStore();
const result = await verifyCredential(credential, discoveryDoc, pinStore);

Python

pip install agentpin
from agentpin.crypto import generate_keypair
from agentpin.credential import issue_credential
from agentpin.verification import verify_credential
from agentpin.pinning import KeyPinStore

private_key, public_key = generate_keypair()

credential = issue_credential(
    private_key,
    issuer="https://example.com",
    agent_id="my-agent",
    capabilities=["read", "write"],
    ttl_secs=3600,
)

pin_store = KeyPinStore()
result = verify_credential(credential, discovery_doc, pin_store)

Serve .well-known Endpoints

cargo run -p agentpin-server -- \
    --identity ./agent-identity.json \
    --revocation ./revocations.json \
    --port 3000

Serves:

  • GET /.well-known/agent-identity.json (Cache-Control: max-age=3600)
  • GET /.well-known/agent-identity-revocations.json (Cache-Control: max-age=300)
  • GET /health

Core Library API

Key Modules

Module Purpose
crypto ECDSA P-256 signing/verification (no external JWT crate)
types Core data structures (agents, credentials, capabilities)
credential JWT issuance and parsing
discovery Publishing and resolving agent identity documents
verification 12-step credential validation flow
revocation Checking revoked credentials/agents/keys
pinning TOFU key pinning with JWK thumbprints
delegation Delegation chain validation
mutual Challenge-response mutual authentication (128-bit nonces)
jwk JWK handling and thumbprint computation
resolver Pluggable discovery resolution

Language API Reference

Operation Rust JavaScript Python
Generate keys crypto::generate_keypair() generateKeypair() generate_keypair()
Issue credential CredentialBuilder::new().sign() issueCredential() issue_credential()
Verify credential verify_credential() verifyCredential() verify_credential()
Key pinning KeyPinStore KeyPinStore KeyPinStore
Trust bundle TrustBundle::from_json() TrustBundle.fromJson() TrustBundle.from_json()
Mutual auth MutualAuth::challenge() createChallenge() create_challenge()

Feature Flags

Feature Purpose
fetch Enables HTTP via reqwest for online discovery
(default) Core library with no HTTP dependency

Key Concepts

ES256 Only

AgentPin exclusively uses ES256 (ECDSA P-256). All other algorithms are rejected. This is enforced inline without an external JWT crate.

12-Step Verification

The credential verification flow includes:

  1. JWT structure parsing
  2. Header algorithm validation (ES256 only)
  3. Signature verification
  4. Issuer domain extraction
  5. Discovery document resolution
  6. Domain binding verification
  7. Key matching (issuer key vs discovery)
  8. TOFU key pinning check
  9. Expiration validation
  10. Revocation checking
  11. Capability validation
  12. Delegation chain verification (if present)

TOFU Key Pinning

On first credential verification for a domain, the agent's public key (JWK thumbprint) is pinned. Subsequent verifications reject different keys for the same domain — detecting key substitution attacks.

Delegation Chains

Agents can delegate capabilities to sub-agents. The delegation chain is validated to ensure:

  • Each link is signed by the delegator
  • Capabilities only narrow (never widen) down the chain
  • Chain depth limits are respected

Mutual Authentication

Challenge-response protocol with 128-bit nonces for bidirectional agent identity verification.


Discovery Document Format

Published at /.well-known/agent-identity.json:

{
    "schema_version": "0.2",
    "domain": "example.com",
    "agents": [
        {
            "agent_id": "my-agent",
            "display_name": "My Agent",
            "description": "A helpful agent",
            "capabilities": ["read", "write"],
            "public_key_jwk": { ... },
            "constraints": {
                "max_ttl_secs": 86400,
                "allowed_scopes": ["api"]
            }
        }
    ],
    "revocation_endpoint": "https://example.com/.well-known/agent-identity-revocations.json",
    "directory_listing": true
}

v0.2.0 Features

Trust Bundles (Offline / Air-Gapped)

Pre-package discovery + revocation data for environments without internet:

from agentpin.bundle import TrustBundle

bundle = TrustBundle.from_json(bundle_json_str)
discovery = bundle.find_discovery("example.com")
revocation = bundle.find_revocation("example.com")

Pluggable Discovery Resolvers

from agentpin.discovery import (
    WellKnownResolver,    # HTTP .well-known lookups
    DnsTxtResolver,       # DNS TXT record lookups
    ManualResolver,       # Pre-configured discovery data
)

Directory Listing

Domains can advertise all their agents via "directory_listing": true in the discovery document. Verifiers can enumerate available agents before issuing challenges.


Development

Build and Test

# Build all crates
cargo build --workspace

# Run all tests
cargo test --workspace

# Lint
cargo clippy --workspace

# Format check
cargo fmt --check

Conventions

  • Rust edition 2021, MSRV 1.70
  • cargo clippy --workspace must pass with zero warnings
  • cargo fmt --check must pass
  • Inline tests in source files (#[cfg(test)] mod tests)
  • ES256 only — reject all other algorithms
  • Feature-gated HTTP: fetch feature enables reqwest

Pro Tips for AI Assistants

  1. ES256 only — never accept RS256, HS256, or any other algorithm
  2. Short-lived credentials — prefer TTLs of hours, not days
  3. Always check revocation before trusting a credential
  4. TOFU pinning means first-seen key is trusted — warn on key changes
  5. Delegation chains should narrow capabilities, never widen them
  6. No external JWT crate — algorithm validation is controlled inline to prevent algorithm confusion attacks
  7. Feature-gate HTTP — use the fetch feature only when online discovery is needed; default is offline-capable
  8. Cross-compatible with SchemaPin — both use ECDSA P-256, same crypto primitives
  9. Trust bundles are ideal for CI/CD and air-gapped deployments — pre-package discovery + revocation data
  10. JavaScript and Python SDKs provide identical verification guarantees to the Rust crate
安全使用建议
This is a coherent developer guide for a cryptographic identity protocol; it appears benign. Before using it, review the upstream code and package distribution (GitHub, PyPI, npm) to ensure you trust the publisher and verify package integrity/signatures. Keep private keys secure (do not share them), and when running server or discovery endpoints consider exposure and caching policies. If you want higher assurance, request the actual source code or a repository link from the skill author and verify release artifacts (checksums/signatures) rather than blindly installing packages named in examples.
功能分析
Type: OpenClaw Skill Name: agentpin Version: 1.0.0 The skill bundle describes 'AgentPin', a legitimate security protocol and tool for domain-anchored cryptographic agent identity verification. The `SKILL.md` provides documentation and code examples for using the tool's features, such as key generation, credential issuance/verification, and server operation. The 'Pro Tips for AI Assistants' section contains security best practices for using AgentPin, not malicious instructions for the agent. While the tool involves file system and network access, these capabilities are inherent to its stated purpose and are not instructed to be used for exfiltration, unauthorized execution, or other malicious activities. No evidence of prompt injection, data exfiltration, persistence, or obfuscation was found.
能力评估
Purpose & Capability
The name/description (domain-anchored agent identity, ES256 JWTs, TOFU pinning, revocation, delegation) matches the SKILL.md content: key generation, JWT issuance/verification, discovery, pinning, and serving .well-known endpoints. Nothing requested (no env vars, no special binaries) is disproportionate to this purpose.
Instruction Scope
SKILL.md is a development/user guide showing how to generate keys, issue and verify credentials, run the CLI/server, and use SDKs. It does not instruct the agent to read unrelated system files or to exfiltrate data; network operations (fetching .well-known, pip/npm installs) are expected for this functionality and are documented as examples.
Install Mechanism
There is no install spec in the skill bundle (instruction-only). The document references obtaining code via cargo/npm/pip or GitHub links, which is normal for a developer guide. The skill itself does not include or automatically download archives or binaries.
Credentials
The skill declares no required environment variables, credentials, or config paths. The operations described (keypair generation, signing, verification, serving discovery endpoints) legitimately require private keys and network access, but those artifacts are under the user's control and are not requested by the skill.
Persistence & Privilege
The skill is not always-enabled and does not request elevated persistence or modifications to other skills or system-wide agent settings. It is an invocation-only developer guide and does not claim or require permanent presence.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install agentpin
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /agentpin 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of AgentPin skill: easy cryptographic identity for AI agents, with cross-language support. - Provides an overview of AgentPin's architecture, protocol flow, and core concepts. - Includes language-specific quick start guides for Rust, JavaScript, and Python. - Documents core modules, features, and verification steps in detail. - Explains TOFU key pinning, delegation chains, and mutual authentication protocols. - Details the structure and endpoints for discovery and revocation documents. - Describes the project layout and feature flags for customization.
元数据
Slug agentpin
版本 1.0.0
许可证
累计安装 1
当前安装数 1
历史版本数 1
常见问题

AgentPin 是什么?

Provides domain-anchored cryptographic identity verification for AI agents using ES256 JWTs, TOFU key pinning, revocation, and delegation chain checks. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 696 次。

如何安装 AgentPin?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install agentpin」即可一键安装,无需额外配置。

AgentPin 是免费的吗?

是的,AgentPin 完全免费(开源免费),可自由下载、安装和使用。

AgentPin 支持哪些平台?

AgentPin 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 AgentPin?

由 Jascha(@jaschadub)开发并维护,当前版本 v1.0.0。

💬 留言讨论