Repository navigation
v0.8.0 (experimental)
Labels follow data across more hops: into sub-agents, over A2A, and to and from FIDES / fides-gateway. The gateway catches up with the latest SEP-2624 and Tool Annotations IG drafts: per-interceptor overrides, interceptors from several servers, and tools that describe themselves with action-metadata.
Upgrading
- No config changes are needed. Everything new is opt-in, with two exceptions that only make things stricter: a tool whose action-metadata says
requiresReview: truenow getsaskwhen no rule blocks it (policy.honorRequiresReview: falseturns that off), and fides-gateway labels on results are now read as server claims. - Claude Code: add a
SubagentStarthook runningadtl-gateway hook, as in the README, so sub-agents are linked to their parent's session. - Audit entries for interceptor runs have a new
timeoutMsfield.
@adtl/gateway
- Per-interceptor overrides (#50):
gateway.interceptorOverrides.<name>setsfailOpen,priorityHint,mode,timeoutMsandhooksfor one interceptor, as SEP-2624's Invoker Overrides describe. Hooks can only be narrowed; an override that widens them, or names an interceptor the server doesn't offer, stops startup.gateway.mode: auditstill wins over a per-interceptormode, and overrides that relaxadtl.policyoradtl.labellog a warning. - The audit log's
interceptorsentries now carrytimeoutMs, andmodeFrom/failOpenFromsayoverridewhen an override applies. - The invoker enforces each interceptor's timeout itself, so an interceptor client that ignores the timeout can no longer hang a call.
checkOverrides(),resolvePriority()and theInterceptorOverridestype are exported.- The gateway passes a request's
_metaon to the upstream when a mutator sets it (used for fides-gateway labels). - More interceptor servers (#51):
gateway.interceptorServers.<id>adds stdio or Streamable HTTP interceptor servers whose interceptors run beside ADTL's, each invoked on the server that advertised it. They don't get ADTL's per-callconfig. Startup stops on an unreachable server, a missing extension capability or a duplicate interceptor name, and warns about mutators that run afteradtl.label. - Sub-agents (#17): a sub-agent shares its parent's session label. The Claude Code hook handles
SubagentStart, linking each sub-agent to the session it was started in, so its built-in tool calls use the parent's label even if they report a session id of their own (addSubagentStartto your hooks; see the README). For other frameworks,ADTL_SESSION_IDmakes a gateway join a parent's session (it wins overCLAUDE_CODE_SESSION_ID), andADTL_AGENT_ID/ADTL_AGENT_TYPEtag every audit entry withagent. initdrafts egress from a tool's action-metadatadestinationahead ofreadOnlyHint/openWorldHint.
@adtl/labels
- Draft action-metadata (#52):
returnMetadata.sourceand.sensitivityfeed result labels,inputMetadata.destinationfeeds egress, andoutcome/requiresRevieware new policy conditions (tool.outcome,tool.requiresReview). Claims from any server can make labels or egress stricter; relaxing needsacceptServerClaims: trueand never overrides your rules. requiresReview: trueturns anallowinto anask(matched: ["tool.requiresReview"]). Turn it off withpolicy.honorRequiresReview: false.readActionMetadata()and the mapping helpers are exported;toolEgress()takes the tool's annotations as an optional fourth argument.- FIDES interop (#19): fides-gateway labels on results (
_meta["com.github.ifc/labels"]) are read as server claims, stricter-only unless the server is allowlisted. Withfides: { emit: true, readers? }, labeled results also carry the label in that form.toFidesRecord()andfidesEvidenceRef()build the trust-annotationsifc.fides.v1scheme record. - A2A trust labels (#18): a draft A2A extension,
docs/a2a-trust-labels-v1.md, carries the sender's session label on A2A Messages and Artifacts, signed with its Ed25519 key and bound to the parts by digest.signA2ALabel()attaches it;readA2ALabel()checks it: a trusted key's label is used as is, another key's can only make things stricter, and a missing, malformed or broken one falls back to a restrictive label. attachLabel()takes an options argument ({ fides: { readers } }), andunionClaims()is exported.
@adtl/interceptors
- Record ids (#48): tool rule
recordIds: <field>makesadtl.labelremember a tainted session's writes by record id in the ledger (ids the write tool was given and returned), and join the label back on reads that return those ids. Labels on records now survive servers whose update replaces the metadata, as Mem0's hosted docs describe. Audit entries getrecordIds: { matched, writers }. - With
fides.emit,adtl.labelputs the session's label on every outgoingtools/callrequest, as_meta["com.github.ifc/labels"]["$"]. Readers come fromfides.readers, else the call's principal, else nobody. adtl.policyreads action-metadata fromconfig.toolAnnotations, which the gateway already passes fromtools/list.
Examples
examples/fake-memorycan act like Mem0's hosted platform as its docs describe it:updateMode: "replace"(--update-replace) replaces metadata on update, andmerge: true(--merge) folds a barer record into a fuller one and hides it unlesssearch_memoryis called withinclude_merged. New tests cover both. Records added in one call now get distinct ids.examples/a2a-labels: two agents pass a tainted summary over A2A; the receiver inherits the label and asks before posting, and a tampered message fails closed.examples/fides-interop: an opt-in check that runs ADTL's emitted labels through fides-gateway's own models and label resolution, in your local fides-gateway checkout. Not part ofnpm test.