Skip to main content

Module security

Module security 

Source
Expand description

P2-5: defense against malicious agents.

A4A agents can be impersonated, tampered with, or hostile. This module provides the building blocks to trust only what you should:

  • Trust directoryTrustRegistry maps agent identities (their card url) to the verification key the directory attests, and keeps a revocation list (CRL). Cards are only trusted when they come from a known agent and their signature verifies against the registered key.
  • Trust chain propagationTrustRegistry::verify_chain walks a delegation path root → … → leaf, verifying every hop was signed by its parent, enforcing a maximum delegation depth and decaying the trust score with each hop (TrustConfig).
  • Least privilegeSandboxConfig restricts an agent’s file/network access and payload size, checked via SandboxConfig::check.

Signature primitives are the HMAC-SHA256 card signatures shared with the client (sign_agent_card / verify_card_signature), so a registry and a client can agree on the same key material.

Structs§

SandboxConfig
Least-privilege limits for a delegated agent (P2-5 sandbox).
TrustConfig
Delegation-depth and trust-decay policy for chain verification.
TrustRegistry
Trust directory: known agents, a revocation list (CRL), and chain policy.
TrustVerification
Result of a successful trust verification.
TrustedAgent
An agent the registry trusts, with the key used to verify its card.

Enums§

AccessRequest
A resource access attempt to be checked against a SandboxConfig.
SecurityError
Error raised when a security check fails.
TrustRole
Role of an agent in a trust hierarchy. Drives the base trust score before hop decay is applied.