Package com.tnsai.identity
Interface AgentPrincipalProvider
- All Known Implementing Classes:
LocalIdentityProvider
public interface AgentPrincipalProvider
SPI for issuing and verifying
AgentPrincipal instances
(TNS-298). Two contracts are deliberately separate so adapters can
specialise:
- Issue — mint an identity from an
AgentDescriptorduring agent construction. The framework's defaultLocalIdentityProviderhashes the spec into a UUID; external providers (ERC-8004, KMS-backed certs, OIDC) reach out to their trust root and return a signed identity. - Verify — check a presented identity (id + signature) is
genuinely issued by this provider. Returns the materialised
AgentPrincipalon success, empty on failure.
Implementations
DefaultLocalIdentityProvider ships with the framework —
UUID-based, no external trust root, suitable for single-tenant
deployments where the framework itself is the trust boundary.
External providers (ERC-8004, AIUC-1, X.509 chain) ship as separate
optional artefacts so tnsai-core stays free of crypto deps.- Since:
- 0.10.0 (TNS-298)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThrown byissue(com.tnsai.identity.AgentDescriptor)when the trust root refuses to mint an identity (revoked spec, blocked tenant, …). -
Method Summary
Modifier and TypeMethodDescriptionissue(AgentDescriptor spec) Mint a new identity for an agent described byspec.Verifysignatureattests toidaccording to this provider's trust root.
-
Method Details
-
issue
Mint a new identity for an agent described byspec. Implementations typically:- Hash
specinto a stable id (or look up an existing id keyed by spec hash, idempotent reissue); - Compute the runtime fingerprint from build hash + config;
- Optionally produce an
Attestationvia the trust root.
- Throws:
NullPointerException- ifspecis nullAgentPrincipalProvider.IdentityIssueException- if the trust root rejects the spec
- Hash
-
verify
Verifysignatureattests toidaccording to this provider's trust root. Returns the materialisedAgentPrincipalon success, empty on signature mismatch or unknown id.The signature payload is opaque to the framework — providers decide what they sign over (id + version + fingerprint, the full attestation bundle, …). External verifiers re-derive the payload via the same provider's algorithm.
- Throws:
NullPointerException- if any arg is null
-