@atps/core
v0.1.0-alpha.0
Published
Official shared primitives (token mint/validate/derive) for the Agent Trust Protocol Stack — used by @atps/ztnp and @atps/ztip.
Maintainers
Readme
@atps/core
Official shared primitives for the Agent Trust Protocol Stack — used by @atps/ztnp and @atps/ztip.
Pre-1.0 alpha. APIs may change before the stable release. Pin an exact version if you depend on this in non-experimental code.
Focused token primitives for agent trust:
mint(intent, scope, signingKey, options?)validate(token, context)derive(parentToken, childIntent, childScope, signingKey, publicKeys, options?)createLogger(logSink?)
The library does three things:
- Signs intent + scope into a compact JWT.
- Verifies signature, expiry, intent hash, and scope authorization.
- Emits structured log records for mint/validate/derive.
Install
npm install @atps/coreQuick Start
import { mint, validate } from "@atps/core";
const token = mint(intent, ["mail.write"], privateKeyPem);
const result = validate(token, {
intent,
requiredScope: ["mail.write.send"],
acceptedVerifyingKeys: [publicKeyPem],
});Key Management Boundaries
- You provide signing and verifying keys.
- The library does not fetch keys over the network.
- The library does not store keys or handle key rotation.
Logging
By default, log records are written as JSON lines to stderr. Pass a custom logger sink to capture records in your own destination.
