@decionis/agentsafe 0.2.5 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +264 -89
- package/dist/Cli.js +24 -0
- package/dist/Cli.js.map +1 -1
- package/dist/Index.d.ts +10 -4
- package/dist/Index.d.ts.map +1 -1
- package/dist/Index.js +8 -2
- package/dist/Index.js.map +1 -1
- package/dist/TrustedExecutor.d.ts.map +1 -1
- package/dist/TrustedExecutor.js +2 -0
- package/dist/TrustedExecutor.js.map +1 -1
- package/dist/adapters/AdapterActionHandler.d.ts.map +1 -1
- package/dist/adapters/AdapterActionHandler.js +8 -4
- package/dist/adapters/AdapterActionHandler.js.map +1 -1
- package/dist/adapters/EffectAdapter.d.ts +6 -1
- package/dist/adapters/EffectAdapter.d.ts.map +1 -1
- package/dist/adapters/EffectAdapter.js +7 -1
- package/dist/adapters/EffectAdapter.js.map +1 -1
- package/dist/adapters/EffectAwareGrantVerifier.d.ts +5 -2
- package/dist/adapters/EffectAwareGrantVerifier.d.ts.map +1 -1
- package/dist/adapters/EffectAwareGrantVerifier.js +9 -0
- package/dist/adapters/EffectAwareGrantVerifier.js.map +1 -1
- package/dist/adapters/banking/BankingAction.d.ts +2 -2
- package/dist/adapters/banking/CoreBankingHttpAdapter.d.ts.map +1 -1
- package/dist/adapters/banking/CoreBankingHttpAdapter.js +4 -4
- package/dist/adapters/banking/CoreBankingHttpAdapter.js.map +1 -1
- package/dist/adapters/cards/CardAuthorizationMatcher.d.ts +44 -0
- package/dist/adapters/cards/CardAuthorizationMatcher.d.ts.map +1 -0
- package/dist/adapters/cards/CardAuthorizationMatcher.js +39 -0
- package/dist/adapters/cards/CardAuthorizationMatcher.js.map +1 -0
- package/dist/adapters/cards/CardEffect.d.ts +52 -0
- package/dist/adapters/cards/CardEffect.d.ts.map +1 -0
- package/dist/adapters/cards/CardEffect.js +117 -0
- package/dist/adapters/cards/CardEffect.js.map +1 -0
- package/dist/adapters/cards/CardHandlers.d.ts +15 -0
- package/dist/adapters/cards/CardHandlers.d.ts.map +1 -0
- package/dist/adapters/cards/CardHandlers.js +26 -0
- package/dist/adapters/cards/CardHandlers.js.map +1 -0
- package/dist/adapters/cards/CardHoldSeal.d.ts +29 -0
- package/dist/adapters/cards/CardHoldSeal.d.ts.map +1 -0
- package/dist/adapters/cards/CardHoldSeal.js +87 -0
- package/dist/adapters/cards/CardHoldSeal.js.map +1 -0
- package/dist/adapters/cards/CardHoldStore.d.ts +102 -0
- package/dist/adapters/cards/CardHoldStore.d.ts.map +1 -0
- package/dist/adapters/cards/CardHoldStore.js +9 -0
- package/dist/adapters/cards/CardHoldStore.js.map +1 -0
- package/dist/adapters/cards/CardHolds.d.ts +19 -0
- package/dist/adapters/cards/CardHolds.d.ts.map +1 -0
- package/dist/adapters/cards/CardHolds.js +57 -0
- package/dist/adapters/cards/CardHolds.js.map +1 -0
- package/dist/adapters/cards/CardPurchase.d.ts +61 -0
- package/dist/adapters/cards/CardPurchase.d.ts.map +1 -0
- package/dist/adapters/cards/CardPurchase.js +116 -0
- package/dist/adapters/cards/CardPurchase.js.map +1 -0
- package/dist/adapters/cards/HeldCardGrants.d.ts +69 -0
- package/dist/adapters/cards/HeldCardGrants.d.ts.map +1 -0
- package/dist/adapters/cards/HeldCardGrants.js +169 -0
- package/dist/adapters/cards/HeldCardGrants.js.map +1 -0
- package/dist/adapters/cards/Pan.d.ts +17 -0
- package/dist/adapters/cards/Pan.d.ts.map +1 -0
- package/dist/adapters/cards/Pan.js +52 -0
- package/dist/adapters/cards/Pan.js.map +1 -0
- package/dist/adapters/cards/PostgresCardHolds.d.ts +95 -0
- package/dist/adapters/cards/PostgresCardHolds.d.ts.map +1 -0
- package/dist/adapters/cards/PostgresCardHolds.js +411 -0
- package/dist/adapters/cards/PostgresCardHolds.js.map +1 -0
- package/dist/adapters/mcp/McpGuard.d.ts.map +1 -1
- package/dist/adapters/mcp/McpGuard.js +9 -4
- package/dist/adapters/mcp/McpGuard.js.map +1 -1
- package/dist/audit/HashChain.d.ts +8 -2
- package/dist/audit/HashChain.d.ts.map +1 -1
- package/dist/audit/HashChain.js +14 -2
- package/dist/audit/HashChain.js.map +1 -1
- package/dist/cli/Cards.d.ts +5 -0
- package/dist/cli/Cards.d.ts.map +1 -0
- package/dist/cli/Cards.js +48 -0
- package/dist/cli/Cards.js.map +1 -0
- package/dist/cli/Commands.d.ts +1 -1
- package/dist/cli/Commands.d.ts.map +1 -1
- package/dist/cli/Commands.js +5 -0
- package/dist/cli/Commands.js.map +1 -1
- package/dist/cli/Edge.d.ts +4 -0
- package/dist/cli/Edge.d.ts.map +1 -0
- package/dist/cli/Edge.js +250 -0
- package/dist/cli/Edge.js.map +1 -0
- package/dist/cli/Help.d.ts.map +1 -1
- package/dist/cli/Help.js +9 -0
- package/dist/cli/Help.js.map +1 -1
- package/dist/cli/Host.d.ts +36 -0
- package/dist/cli/Host.d.ts.map +1 -0
- package/dist/cli/Host.js +247 -0
- package/dist/cli/Host.js.map +1 -0
- package/dist/cli/TcpBrokerCli.d.ts +4 -0
- package/dist/cli/TcpBrokerCli.d.ts.map +1 -0
- package/dist/cli/TcpBrokerCli.js +93 -0
- package/dist/cli/TcpBrokerCli.js.map +1 -0
- package/dist/cli/TcpClientCli.d.ts +16 -0
- package/dist/cli/TcpClientCli.d.ts.map +1 -0
- package/dist/cli/TcpClientCli.js +175 -0
- package/dist/cli/TcpClientCli.js.map +1 -0
- package/dist/config/ConfigKeys.d.ts +2 -2
- package/dist/config/ConfigKeys.d.ts.map +1 -1
- package/dist/config/ConfigKeys.js +31 -0
- package/dist/config/ConfigKeys.js.map +1 -1
- package/dist/config/ExecutorConfig.d.ts +115 -0
- package/dist/config/ExecutorConfig.d.ts.map +1 -1
- package/dist/config/ExecutorConfig.js +212 -0
- package/dist/config/ExecutorConfig.js.map +1 -1
- package/dist/edge/EdgeLicence.d.ts +25 -0
- package/dist/edge/EdgeLicence.d.ts.map +1 -0
- package/dist/edge/EdgeLicence.js +42 -0
- package/dist/edge/EdgeLicence.js.map +1 -0
- package/dist/edge/EdgeReplay.d.ts +45 -0
- package/dist/edge/EdgeReplay.d.ts.map +1 -0
- package/dist/edge/EdgeReplay.js +69 -0
- package/dist/edge/EdgeReplay.js.map +1 -0
- package/dist/edge/Entitlement.d.ts +57 -0
- package/dist/edge/Entitlement.d.ts.map +1 -0
- package/dist/edge/Entitlement.js +139 -0
- package/dist/edge/Entitlement.js.map +1 -0
- package/dist/edge/EntitlementEvaluation.d.ts +66 -0
- package/dist/edge/EntitlementEvaluation.d.ts.map +1 -0
- package/dist/edge/EntitlementEvaluation.js +74 -0
- package/dist/edge/EntitlementEvaluation.js.map +1 -0
- package/dist/edge/UsageCount.d.ts +40 -0
- package/dist/edge/UsageCount.d.ts.map +1 -0
- package/dist/edge/UsageCount.js +140 -0
- package/dist/edge/UsageCount.js.map +1 -0
- package/dist/edge/UsageKeyRegistration.d.ts +34 -0
- package/dist/edge/UsageKeyRegistration.d.ts.map +1 -0
- package/dist/edge/UsageKeyRegistration.js +74 -0
- package/dist/edge/UsageKeyRegistration.js.map +1 -0
- package/dist/edge/UsageMeter.d.ts +89 -0
- package/dist/edge/UsageMeter.d.ts.map +1 -0
- package/dist/edge/UsageMeter.js +275 -0
- package/dist/edge/UsageMeter.js.map +1 -0
- package/dist/edge/UsagePeriod.d.ts +23 -0
- package/dist/edge/UsagePeriod.d.ts.map +1 -0
- package/dist/edge/UsagePeriod.js +31 -0
- package/dist/edge/UsagePeriod.js.map +1 -0
- package/dist/edge/UsageReport.d.ts +92 -0
- package/dist/edge/UsageReport.d.ts.map +1 -0
- package/dist/edge/UsageReport.js +153 -0
- package/dist/edge/UsageReport.js.map +1 -0
- package/dist/edge/UsageTally.d.ts +63 -0
- package/dist/edge/UsageTally.d.ts.map +1 -0
- package/dist/edge/UsageTally.js +89 -0
- package/dist/edge/UsageTally.js.map +1 -0
- package/dist/egress/EgressError.d.ts +7 -1
- package/dist/egress/EgressError.d.ts.map +1 -1
- package/dist/egress/EgressError.js.map +1 -1
- package/dist/egress/EgressPolicy.d.ts +16 -3
- package/dist/egress/EgressPolicy.d.ts.map +1 -1
- package/dist/egress/EgressPolicy.js +33 -3
- package/dist/egress/EgressPolicy.js.map +1 -1
- package/dist/egress/GuardedFetch.d.ts +38 -1
- package/dist/egress/GuardedFetch.d.ts.map +1 -1
- package/dist/egress/GuardedFetch.js +52 -7
- package/dist/egress/GuardedFetch.js.map +1 -1
- package/dist/egress/TcpClient.d.ts +103 -0
- package/dist/egress/TcpClient.d.ts.map +1 -0
- package/dist/egress/TcpClient.js +490 -0
- package/dist/egress/TcpClient.js.map +1 -0
- package/dist/egress/TcpControlClient.d.ts +49 -0
- package/dist/egress/TcpControlClient.d.ts.map +1 -0
- package/dist/egress/TcpControlClient.js +186 -0
- package/dist/egress/TcpControlClient.js.map +1 -0
- package/dist/gateway/ForwardHandler.d.ts.map +1 -1
- package/dist/gateway/ForwardHandler.js +7 -4
- package/dist/gateway/ForwardHandler.js.map +1 -1
- package/dist/gateway/Gateway.d.ts +190 -10
- package/dist/gateway/Gateway.d.ts.map +1 -1
- package/dist/gateway/Gateway.js +465 -62
- package/dist/gateway/Gateway.js.map +1 -1
- package/dist/gateway/GatewayConfig.d.ts +67 -0
- package/dist/gateway/GatewayConfig.d.ts.map +1 -1
- package/dist/gateway/GatewayConfig.js +149 -2
- package/dist/gateway/GatewayConfig.js.map +1 -1
- package/dist/gateway/InterceptedRequest.d.ts +9 -2
- package/dist/gateway/InterceptedRequest.d.ts.map +1 -1
- package/dist/gateway/InterceptedRequest.js +41 -9
- package/dist/gateway/InterceptedRequest.js.map +1 -1
- package/dist/gateway/RateLimit.d.ts +29 -0
- package/dist/gateway/RateLimit.d.ts.map +1 -0
- package/dist/gateway/RateLimit.js +33 -0
- package/dist/gateway/RateLimit.js.map +1 -0
- package/dist/gateway/RefusalSampler.d.ts +28 -0
- package/dist/gateway/RefusalSampler.d.ts.map +1 -0
- package/dist/gateway/RefusalSampler.js +52 -0
- package/dist/gateway/RefusalSampler.js.map +1 -0
- package/dist/gateway/RouteTable.d.ts +3 -0
- package/dist/gateway/RouteTable.d.ts.map +1 -1
- package/dist/gateway/RouteTable.js +44 -7
- package/dist/gateway/RouteTable.js.map +1 -1
- package/dist/gateway/Upstream.d.ts +26 -0
- package/dist/gateway/Upstream.d.ts.map +1 -1
- package/dist/gateway/Upstream.js +41 -2
- package/dist/gateway/Upstream.js.map +1 -1
- package/dist/gateway/UpstreamProof.d.ts +235 -0
- package/dist/gateway/UpstreamProof.d.ts.map +1 -0
- package/dist/gateway/UpstreamProof.js +375 -0
- package/dist/gateway/UpstreamProof.js.map +1 -0
- package/dist/handlers/ForwardRequestHandler.d.ts +5 -1
- package/dist/handlers/ForwardRequestHandler.d.ts.map +1 -1
- package/dist/handlers/ForwardRequestHandler.js +12 -2
- package/dist/handlers/ForwardRequestHandler.js.map +1 -1
- package/dist/hosted/TenantHost.d.ts +180 -0
- package/dist/hosted/TenantHost.d.ts.map +1 -0
- package/dist/hosted/TenantHost.js +432 -0
- package/dist/hosted/TenantHost.js.map +1 -0
- package/dist/hosted/TenantRegistry.d.ts +73 -0
- package/dist/hosted/TenantRegistry.d.ts.map +1 -0
- package/dist/hosted/TenantRegistry.js +123 -0
- package/dist/hosted/TenantRegistry.js.map +1 -0
- package/dist/http/ExecutorHttpServer.d.ts +7 -0
- package/dist/http/ExecutorHttpServer.d.ts.map +1 -1
- package/dist/http/ExecutorHttpServer.js +30 -5
- package/dist/http/ExecutorHttpServer.js.map +1 -1
- package/dist/http/GatewayHttpServer.d.ts +55 -3
- package/dist/http/GatewayHttpServer.d.ts.map +1 -1
- package/dist/http/GatewayHttpServer.js +157 -17
- package/dist/http/GatewayHttpServer.js.map +1 -1
- package/dist/http/RedirectServer.d.ts +26 -0
- package/dist/http/RedirectServer.d.ts.map +1 -0
- package/dist/http/RedirectServer.js +62 -0
- package/dist/http/RedirectServer.js.map +1 -0
- package/dist/http/Routes.d.ts +24 -0
- package/dist/http/Routes.d.ts.map +1 -1
- package/dist/http/Routes.js +28 -1
- package/dist/http/Routes.js.map +1 -1
- package/dist/http/TcpBroker.d.ts +57 -0
- package/dist/http/TcpBroker.d.ts.map +1 -0
- package/dist/http/TcpBroker.js +299 -0
- package/dist/http/TcpBroker.js.map +1 -0
- package/dist/http/TcpHostRelay.d.ts +24 -0
- package/dist/http/TcpHostRelay.d.ts.map +1 -0
- package/dist/http/TcpHostRelay.js +194 -0
- package/dist/http/TcpHostRelay.js.map +1 -0
- package/dist/http/TcpRelayStreams.d.ts +24 -0
- package/dist/http/TcpRelayStreams.d.ts.map +1 -0
- package/dist/http/TcpRelayStreams.js +128 -0
- package/dist/http/TcpRelayStreams.js.map +1 -0
- package/dist/http/TlsListener.d.ts +3 -1
- package/dist/http/TlsListener.d.ts.map +1 -1
- package/dist/http/TlsListener.js +7 -2
- package/dist/http/TlsListener.js.map +1 -1
- package/dist/identity/Authenticator.d.ts.map +1 -1
- package/dist/identity/Authenticator.js +5 -2
- package/dist/identity/Authenticator.js.map +1 -1
- package/dist/identity/PrincipalsFile.d.ts +5 -1
- package/dist/identity/PrincipalsFile.d.ts.map +1 -1
- package/dist/identity/PrincipalsFile.js +2 -0
- package/dist/identity/PrincipalsFile.js.map +1 -1
- package/dist/incident/Metrics.d.ts +2 -0
- package/dist/incident/Metrics.d.ts.map +1 -1
- package/dist/incident/Metrics.js +10 -0
- package/dist/incident/Metrics.js.map +1 -1
- package/dist/incident/SecurityEvents.d.ts +98 -0
- package/dist/incident/SecurityEvents.d.ts.map +1 -1
- package/dist/incident/SecurityEvents.js +96 -2
- package/dist/incident/SecurityEvents.js.map +1 -1
- package/dist/journal/ExecutionJournal.d.ts +27 -0
- package/dist/journal/ExecutionJournal.d.ts.map +1 -1
- package/dist/journal/ExecutionJournal.js +28 -0
- package/dist/journal/ExecutionJournal.js.map +1 -1
- package/dist/journal/FileExecutionJournal.d.ts +2 -1
- package/dist/journal/FileExecutionJournal.d.ts.map +1 -1
- package/dist/journal/FileExecutionJournal.js +4 -1
- package/dist/journal/FileExecutionJournal.js.map +1 -1
- package/dist/journal/InMemoryExecutionJournal.d.ts +2 -1
- package/dist/journal/InMemoryExecutionJournal.d.ts.map +1 -1
- package/dist/journal/InMemoryExecutionJournal.js +4 -1
- package/dist/journal/InMemoryExecutionJournal.js.map +1 -1
- package/dist/service/AuthorityClients.d.ts +8 -1
- package/dist/service/AuthorityClients.d.ts.map +1 -1
- package/dist/service/AuthorityClients.js +33 -5
- package/dist/service/AuthorityClients.js.map +1 -1
- package/dist/service/EdgeRuntime.d.ts +73 -0
- package/dist/service/EdgeRuntime.d.ts.map +1 -0
- package/dist/service/EdgeRuntime.js +209 -0
- package/dist/service/EdgeRuntime.js.map +1 -0
- package/dist/service/EscalationResolver.d.ts +109 -5
- package/dist/service/EscalationResolver.d.ts.map +1 -1
- package/dist/service/EscalationResolver.js +41 -3
- package/dist/service/EscalationResolver.js.map +1 -1
- package/dist/service/Requests.d.ts +45 -2
- package/dist/service/Requests.d.ts.map +1 -1
- package/dist/service/TrustedExecutorService.d.ts +144 -1
- package/dist/service/TrustedExecutorService.d.ts.map +1 -1
- package/dist/service/TrustedExecutorService.js +866 -37
- package/dist/service/TrustedExecutorService.js.map +1 -1
- package/dist/tcp/TcpWire.d.ts +18 -0
- package/dist/tcp/TcpWire.d.ts.map +1 -0
- package/dist/tcp/TcpWire.js +114 -0
- package/dist/tcp/TcpWire.js.map +1 -0
- package/dist/verify/VerifyAuditChain.d.ts +5 -0
- package/dist/verify/VerifyAuditChain.d.ts.map +1 -1
- package/dist/verify/VerifyAuditChain.js +20 -4
- package/dist/verify/VerifyAuditChain.js.map +1 -1
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -18,12 +18,23 @@ npm install @decionis/agentsafe
|
|
|
18
18
|
|
|
19
19
|
## The gateway
|
|
20
20
|
|
|
21
|
+
For client routing, on-premises Docker/Kubernetes setup and managed-cloud onboarding, see the
|
|
22
|
+
[gateway deployment guide](../../docs/gateway/deployment.md). A bank-operated gateway can enforce
|
|
23
|
+
against the hosted authority; the Decionis-managed gateway currently runs in shadow only.
|
|
24
|
+
|
|
21
25
|
The same runtime is also an HTTP-interception gateway: put it in front of an agent, an API or a
|
|
22
26
|
service, and every `POST`, `PUT`, `PATCH` and `DELETE` that passes through it is captured as an
|
|
23
27
|
intent, decided by the authority, and forwarded byte for byte only on an `ALLOW`, once, under a
|
|
24
28
|
claimed single-use grant. A `BLOCK` is refused, an `ESCALATE` is held, and an authority that
|
|
25
29
|
cannot be reached is its own state, never a verdict.
|
|
26
30
|
|
|
31
|
+
With interception enabled, only `GET`, `HEAD` and `OPTIONS` pass as safe methods. Unsupported
|
|
32
|
+
methods return `405 HTTP_METHOD_UNSUPPORTED`; method-override headers and ambiguous routing paths
|
|
33
|
+
are refused before forwarding. Route matching decodes literal path characters once, so encoded
|
|
34
|
+
names cannot hide a governed route. `RoutePlan` includes `REFUSE` for these admission failures.
|
|
35
|
+
The captured `context.request_sha256` binds the raw query, headers, transport metadata and body;
|
|
36
|
+
the forwarding handler checks it again before dispatch. Raw headers are not sent to the authority.
|
|
37
|
+
|
|
27
38
|
```bash
|
|
28
39
|
npm install -g @decionis/agentsafe
|
|
29
40
|
agentsafe proxy --upstream http://localhost:3000 --port 8080
|
|
@@ -139,20 +150,22 @@ where those controls are written down.
|
|
|
139
150
|
|
|
140
151
|
## The wire contract
|
|
141
152
|
|
|
142
|
-
| Method | Path
|
|
143
|
-
| ------ |
|
|
144
|
-
| `GET` | `/health`
|
|
145
|
-
| `GET` | `/ready`
|
|
146
|
-
| `POST` | `/v1/actions`
|
|
147
|
-
| `POST` | `/v1/reconciliations`
|
|
148
|
-
| `POST` | `/v1/escalations`
|
|
149
|
-
| `GET` | `/v1/control/status`
|
|
150
|
-
| `POST` | `/v1/control/halt`
|
|
151
|
-
| `POST` | `/v1/control/resume`
|
|
152
|
-
| `GET` | `/v1/control/open-attempts`
|
|
153
|
-
| `POST` | `/v1/control/secrets/reload`
|
|
154
|
-
| `POST` | `/v1/control/evidence-export`
|
|
155
|
-
| `GET` | `/metrics`
|
|
153
|
+
| Method | Path | Who | What it does |
|
|
154
|
+
| ------ | --------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
|
|
155
|
+
| `GET` | `/health` | anyone | The process is up |
|
|
156
|
+
| `GET` | `/ready` | anyone | Ready, or 503 while halted or still resolving an attempt; reports the mode and the actions |
|
|
157
|
+
| `POST` | `/v1/actions` | a `PROPOSER` | Capture, evaluate, and in enforcement execute once on an `ALLOW` |
|
|
158
|
+
| `POST` | `/v1/reconciliations` | the `PROPOSER` that proposed | Read-only: what the provider did with an attempt whose answer was lost |
|
|
159
|
+
| `POST` | `/v1/escalations` | the `PROPOSER` that proposed, or an `OPERATOR` with `escalations.resume` presenting an attestation | Resume an open escalation: one lookup, then a fresh decision if the person answered |
|
|
160
|
+
| `GET` | `/v1/control/status` | an `OPERATOR` with `status` | Mode, actions, posture, principals, the chain's head, the halt, the open attempts |
|
|
161
|
+
| `POST` | `/v1/control/halt` | an `OPERATOR` with `halt` | Stop taking new work, with a reason |
|
|
162
|
+
| `POST` | `/v1/control/resume` | an `OPERATOR` with `resume` | Take work again, with a reason; refused while the cause of the halt stands |
|
|
163
|
+
| `GET` | `/v1/control/open-attempts` | an `OPERATOR` with `status` | The attempts whose outcome this process does not know |
|
|
164
|
+
| `POST` | `/v1/control/secrets/reload` | an `OPERATOR` with `secrets.reload` | Re-read every secret file now; the report names files, never values |
|
|
165
|
+
| `POST` | `/v1/control/evidence-export` | an `OPERATOR` with `evidence` | Write a bundle of this process's own evidence, and return its manifest |
|
|
166
|
+
| `GET` | `/metrics` | an `OPERATOR` with `metrics` | The OpenMetrics exposition |
|
|
167
|
+
| `POST` | `/v1/card-authorizations` | an `OPERATOR` with `cards.authorize` | The card issuer's authorization hook: match it to a held grant, and claim that grant once |
|
|
168
|
+
| `POST` | `/v1/card-authorizations/{authorization_id}/result` | an `OPERATOR` with `cards.authorize` | What the issuer did with it: finalize the claimed grant with the effect |
|
|
156
169
|
|
|
157
170
|
Who may call is the principals file, described below; without one, the one legacy caller presents
|
|
158
171
|
the caller token as `Authorization: Bearer <token>`. Every request that is not public passes the
|
|
@@ -261,8 +274,11 @@ When a provider took the request and the response was lost, the answer is `UNKNO
|
|
|
261
274
|
with `executed: null` and a `recovery` object: the exact intent and the recovery reference. Present
|
|
262
275
|
that object back, unchanged, and the executor asks the provider what it did with the idempotency
|
|
263
276
|
key, never sending the request again. The intent is re-hashed on the way in, so a changed intent no
|
|
264
|
-
longer matches its reference and is refused with `RECOVERY_BINDING_MISMATCH`. The
|
|
265
|
-
|
|
277
|
+
longer matches its reference and is refused with `RECOVERY_BINDING_MISMATCH`. The reference's
|
|
278
|
+
decision, dossier, grant and expiry are the caller's claim, so they are held against the attempt the
|
|
279
|
+
journal recorded before dispatch: a binding the journal does not hold is refused with
|
|
280
|
+
`RECOVERY_BINDING_MISMATCH`, and an intent it never recorded with `RECOVERY_ATTEMPT_UNKNOWN`, before
|
|
281
|
+
the provider is asked. A refused reconciliation leaves the attempt open for the next start.
|
|
266
282
|
|
|
267
283
|
### `POST /v1/escalations`
|
|
268
284
|
|
|
@@ -284,81 +300,149 @@ nothing, and an intent past `EXECUTOR_INTENT_TTL_SECONDS` is refused with `409 I
|
|
|
284
300
|
approval cannot revive an expired intent. Nothing waits inside a request, and nothing is kept
|
|
285
301
|
between two.
|
|
286
302
|
|
|
303
|
+
A third way to resume needs no Presence ceremony and works in either shape, or with
|
|
304
|
+
`EXECUTOR_ESCALATION=NONE`: a presence provider's signed attestation over the intent, such as a
|
|
305
|
+
cardholder tapping their own card. Present `{ mode: "ATTESTATION", intent, attestation }`, where
|
|
306
|
+
`attestation` is the provider's compact JWS (at most 20,000 characters). The executor checks only
|
|
307
|
+
its shape, sends it to the authority as `evidence.humanApproval: { provider: "attestation",
|
|
308
|
+
attestation }` for a fresh evaluation of the same intent, and keeps nothing of it: the token is
|
|
309
|
+
never logged, never written to the evidence stream or the journal, and not sent again with the
|
|
310
|
+
claim. The authority verifies the signature under the key the organisation registered for its
|
|
311
|
+
provider and binds it to the intent hash; an attestation it cannot verify is a fail-closed `BLOCK`,
|
|
312
|
+
and one it verifies becomes an `ALLOW` only where policy has a rule matching the approval. A card
|
|
313
|
+
purchase escalated with no Presence handoff is handed `{ mode: "ATTESTATION", intent, requirement }`
|
|
314
|
+
for exactly this.
|
|
315
|
+
|
|
316
|
+
When the authority says where a hold goes, the handoff carries it as `requirement`:
|
|
317
|
+
`{ requirement_id, expires_at, selector: { kind, role_id? } | null, verification: { provider,
|
|
318
|
+
methods, level } | null }`, the policy's selector (a kind and a role, never a person) and who
|
|
319
|
+
proves the person. A `verification.provider` other than `decionis` names a presence provider the
|
|
320
|
+
organisation admitted, such as a card tap through the issuer's app (`koard`, method `CARD_TAP`):
|
|
321
|
+
no Presence ceremony is asked for, whatever `EXECUTOR_ESCALATION` says, and only that provider's
|
|
322
|
+
attestation resumes the hold. The decision carries the routing from Decionis for a runtime at
|
|
323
|
+
0.3.7 or later; an older authority says nothing and `requirement` is `null`.
|
|
324
|
+
|
|
325
|
+
The tap lands with the issuer's app, not with the agent that proposed. An `OPERATOR` holding
|
|
326
|
+
`escalations.resume` may therefore present `{ mode: "ATTESTATION", intent, attestation }` for an
|
|
327
|
+
intent it did not propose, and nothing else: a Presence handoff from an operator is
|
|
328
|
+
`403 ROLE_FORBIDDEN`. The operator adds no authority, because the authority binds the attestation
|
|
329
|
+
to the intent hash and evaluates the policy again; the intent is re-hashed on the way in, so an
|
|
330
|
+
intent altered in transit (a card number written into it, say) is refused before anything is
|
|
331
|
+
asked. Every line the resumption produces names the operator as its principal.
|
|
332
|
+
|
|
287
333
|
## Configuration
|
|
288
334
|
|
|
289
335
|
Every variable, in one list (`CONFIG_KEYS`). A missing or invalid value is a refusal to start that
|
|
290
336
|
names the variable and never its value. Nothing that identifies a tenant, a system, a person or a
|
|
291
337
|
network path has a default.
|
|
292
338
|
|
|
293
|
-
| Variable | Meaning
|
|
294
|
-
| ------------------------------------------------------------- |
|
|
295
|
-
| `EXECUTOR_MODE` | `SHADOW` or `ENFORCEMENT`
|
|
296
|
-
| `EXECUTOR_BIND_ADDRESS`, `PORT` | Where the listener binds
|
|
297
|
-
| `EXECUTOR_TENANT_ID` | Legacy mode only: the Decionis tenant, a UUID
|
|
298
|
-
| `EXECUTOR_ACTOR_ID`, `_TYPE` | Legacy mode only: the actor the intent names; `EXECUTOR_ACTOR_RUNTIME` is optional
|
|
299
|
-
| `EXECUTOR_INTENT_TTL_SECONDS` | How long a proposal stays valid, at most five minutes; a ceremony has to finish inside it
|
|
300
|
-
| `EXECUTOR_CALLER_TOKEN` | Legacy mode only: the token the one caller presents; secret
|
|
301
|
-
| `EXECUTOR_PRINCIPALS_FILE` | The principals file; excludes `EXECUTOR_TENANT_ID`, `EXECUTOR_ACTOR_*` and the caller token; required in production
|
|
302
|
-
| `EXECUTOR_ALLOW_LEGACY_CALLER` | `true` lets production run without a principals file, on the legacy caller alone
|
|
303
|
-
| `EXECUTOR_JWT_AUDIENCE`, `EXECUTOR_JWKS_FILE` | Together: the audience workload tokens must carry, and the JWKS they are verified against
|
|
304
|
-
| `EXECUTOR_JWKS_URL`, `EXECUTOR_JWKS_CA_FILE` | Optional: where the JWKS is refreshed from through the guarded fetch, and the bundle that address is verified against
|
|
305
|
-
| `EXECUTOR_JWKS_REFRESH_SECONDS` | How often, one minute to a day, five minutes by default
|
|
306
|
-
| `EXECUTOR_JWT_CLOCK_TOLERANCE_SECONDS` | Leeway on a token's times, up to five minutes, thirty seconds by default
|
|
307
|
-
| `EXECUTOR_RATE_LIMIT_UNAUTHENTICATED` | `<count>/<seconds>` for attempts that never became a principal; `20/60` by default
|
|
308
|
-
| `EXECUTOR_AUTH_LOCKOUT` | `<failures>/<seconds>/<lock seconds>` for a principal's proven failures; `10/60/300` by default, `0/…` disables
|
|
309
|
-
| `EXECUTOR_ESCALATION` | `NONE`, `DIRECT` or `MANAGED`; refused in shadow, which never escalates
|
|
310
|
-
| `EXECUTOR_POSTURE` | `ENFORCED` (the default) or `DEVELOPMENT`, which waives the host checks and says so; refused under `NODE_ENV=production`
|
|
311
|
-
| `EXECUTOR_POSTURE_INTERVAL_SECONDS` | How often the drift checks repeat while running; ten seconds to ten minutes, sixty by default
|
|
312
|
-
| `EXECUTOR_SECRETS_DIR` | The directory every `<NAME>_FILE` must resolve inside; required in production when any file is mounted
|
|
313
|
-
| `EXECUTOR_TLS_CERT_FILE`, `EXECUTOR_TLS_KEY` | The listener's certificate chain and its private key; the key is a secret, given as `EXECUTOR_TLS_KEY_FILE` in production
|
|
314
|
-
| `EXECUTOR_TLS_CLIENT_CA_FILE` | Optional: the CA that callers' client certificates chain to; every non-public route then requires one
|
|
315
|
-
| `EXECUTOR_TLS_MIN_VERSION` | `1.3` (the default) or `1.2`, which admits TLS 1.2 with AEAD ciphers only
|
|
316
|
-
| `EXECUTOR_ALLOW_PLAINTEXT_LISTENER` | `true` runs the listener without TLS, for a developer's machine; refused under `NODE_ENV=production`
|
|
317
|
-
| `EXECUTOR_EGRESS_MAX_RESPONSE_BYTES` | The most any outbound response may carry, 1 KiB to 16 MiB, 1 MiB by default
|
|
318
|
-
| `EXECUTOR_JOURNAL_DIR` | Where the evidence chains' heads and the attempt journal live; absolute, writable, required in enforcement
|
|
319
|
-
| `EXECUTOR_JOURNAL_REQUIRED` | `false` lets enforcement run without a journal, for a developer's machine; refused under `NODE_ENV=production`
|
|
320
|
-
| `EXECUTOR_JOURNAL_RETAIN_DAYS` | How many days of attempt files a restart reads back, one to a year, seven by default
|
|
321
|
-
| `EXECUTOR_READY_REQUIRES_NO_UNKNOWN_ATTEMPTS` | `true` keeps `/ready` at 503 while any attempt's outcome is unknown
|
|
322
|
-
| `EXECUTOR_HALT_FILE` | Optional: a file whose presence halts the executor, watched and polled
|
|
323
|
-
| `EXECUTOR_HALT_ON_AUTH_FAILURES` | `<count>/<seconds>` of door refusals that halt the executor; `50/60` by default
|
|
324
|
-
| `EXECUTOR_HALT_ON_EGRESS_REFUSALS` | `<count>/<seconds>` of refused outbound requests that halt it; `5/60` by default
|
|
325
|
-
| `EXECUTOR_HARD_LIMIT_SINGLE_MINOR` | `CHF:2500000000,EUR:1000000`: the most one action may move, per currency, in minor units
|
|
326
|
-
| `EXECUTOR_HARD_LIMIT_WINDOW_SECONDS` | The window the count and sum below are measured over; required with either
|
|
327
|
-
| `EXECUTOR_HARD_LIMIT_WINDOW_COUNT` | Optional: the most actions that may execute inside the window
|
|
328
|
-
| `EXECUTOR_HARD_LIMIT_WINDOW_SUM_MINOR` | Optional: the most value that may move inside the window, in minor units
|
|
329
|
-
| `EXECUTOR_MAX_CLOCK_SKEW_MS` | How far the authority's clock may differ before the executor halts; two seconds by default
|
|
330
|
-
| `EXECUTOR_AUDIT_CHECKPOINT_LINES` | How many chained lines between persisted heads, one hundred by default
|
|
331
|
-
| `EXECUTOR_EVIDENCE_DIR` | Where an operator's evidence bundle is written; exporting is refused with `409` when absent
|
|
332
|
-
| `EXECUTOR_EVIDENCE_WINDOW_LINES` | Lines of each stream this process keeps for a bundle, 100 to 200000, five thousand by default
|
|
333
|
-
| `EXECUTOR_EVIDENCE_SIGNING_KEY` | Optional Ed25519 PKCS#8 key that signs a bundle's manifest; secret, and needs an evidence directory
|
|
334
|
-
| `EXECUTOR_IMAGE_DIGEST` | What the platform says this deployment is running; carried into a bundle and marked not self-verified
|
|
335
|
-
| `
|
|
336
|
-
| `
|
|
337
|
-
| `
|
|
338
|
-
| `
|
|
339
|
-
| `
|
|
340
|
-
| `
|
|
341
|
-
| `
|
|
342
|
-
| `
|
|
343
|
-
| `
|
|
344
|
-
| `
|
|
345
|
-
| `
|
|
346
|
-
| `
|
|
347
|
-
| `
|
|
348
|
-
| `
|
|
349
|
-
| `
|
|
350
|
-
| `
|
|
351
|
-
| `
|
|
352
|
-
| `
|
|
353
|
-
| `
|
|
354
|
-
| `
|
|
355
|
-
| `
|
|
356
|
-
| `
|
|
357
|
-
| `
|
|
358
|
-
| `
|
|
359
|
-
| `
|
|
360
|
-
| `
|
|
361
|
-
| `
|
|
339
|
+
| Variable | Meaning |
|
|
340
|
+
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
341
|
+
| `EXECUTOR_MODE` | `SHADOW` or `ENFORCEMENT` |
|
|
342
|
+
| `EXECUTOR_BIND_ADDRESS`, `PORT` | Where the listener binds |
|
|
343
|
+
| `EXECUTOR_TENANT_ID` | Legacy mode only: the Decionis tenant, a UUID |
|
|
344
|
+
| `EXECUTOR_ACTOR_ID`, `_TYPE` | Legacy mode only: the actor the intent names; `EXECUTOR_ACTOR_RUNTIME` is optional |
|
|
345
|
+
| `EXECUTOR_INTENT_TTL_SECONDS` | How long a proposal stays valid, at most five minutes; a ceremony has to finish inside it |
|
|
346
|
+
| `EXECUTOR_CALLER_TOKEN` | Legacy mode only: the token the one caller presents; secret |
|
|
347
|
+
| `EXECUTOR_PRINCIPALS_FILE` | The principals file; excludes `EXECUTOR_TENANT_ID`, `EXECUTOR_ACTOR_*` and the caller token; required in production |
|
|
348
|
+
| `EXECUTOR_ALLOW_LEGACY_CALLER` | `true` lets production run without a principals file, on the legacy caller alone |
|
|
349
|
+
| `EXECUTOR_JWT_AUDIENCE`, `EXECUTOR_JWKS_FILE` | Together: the audience workload tokens must carry, and the JWKS they are verified against |
|
|
350
|
+
| `EXECUTOR_JWKS_URL`, `EXECUTOR_JWKS_CA_FILE` | Optional: where the JWKS is refreshed from through the guarded fetch, and the bundle that address is verified against |
|
|
351
|
+
| `EXECUTOR_JWKS_REFRESH_SECONDS` | How often, one minute to a day, five minutes by default |
|
|
352
|
+
| `EXECUTOR_JWT_CLOCK_TOLERANCE_SECONDS` | Leeway on a token's times, up to five minutes, thirty seconds by default |
|
|
353
|
+
| `EXECUTOR_RATE_LIMIT_UNAUTHENTICATED` | `<count>/<seconds>` for attempts that never became a principal; `20/60` by default |
|
|
354
|
+
| `EXECUTOR_AUTH_LOCKOUT` | `<failures>/<seconds>/<lock seconds>` for a principal's proven failures; `10/60/300` by default, `0/…` disables |
|
|
355
|
+
| `EXECUTOR_ESCALATION` | `NONE`, `DIRECT` or `MANAGED`; refused in shadow, which never escalates |
|
|
356
|
+
| `EXECUTOR_POSTURE` | `ENFORCED` (the default) or `DEVELOPMENT`, which waives the host checks and says so; refused under `NODE_ENV=production` |
|
|
357
|
+
| `EXECUTOR_POSTURE_INTERVAL_SECONDS` | How often the drift checks repeat while running; ten seconds to ten minutes, sixty by default |
|
|
358
|
+
| `EXECUTOR_SECRETS_DIR` | The directory every `<NAME>_FILE` must resolve inside; required in production when any file is mounted |
|
|
359
|
+
| `EXECUTOR_TLS_CERT_FILE`, `EXECUTOR_TLS_KEY` | The listener's certificate chain and its private key; the key is a secret, given as `EXECUTOR_TLS_KEY_FILE` in production |
|
|
360
|
+
| `EXECUTOR_TLS_CLIENT_CA_FILE` | Optional: the CA that callers' client certificates chain to; every non-public route then requires one |
|
|
361
|
+
| `EXECUTOR_TLS_MIN_VERSION` | `1.3` (the default) or `1.2`, which admits TLS 1.2 with AEAD ciphers only |
|
|
362
|
+
| `EXECUTOR_ALLOW_PLAINTEXT_LISTENER` | `true` runs the listener without TLS, for a developer's machine; refused under `NODE_ENV=production` |
|
|
363
|
+
| `EXECUTOR_EGRESS_MAX_RESPONSE_BYTES` | The most any outbound response may carry, 1 KiB to 16 MiB, 1 MiB by default |
|
|
364
|
+
| `EXECUTOR_JOURNAL_DIR` | Where the evidence chains' heads and the attempt journal live; absolute, writable, required in enforcement |
|
|
365
|
+
| `EXECUTOR_JOURNAL_REQUIRED` | `false` lets enforcement run without a journal, for a developer's machine; refused under `NODE_ENV=production` |
|
|
366
|
+
| `EXECUTOR_JOURNAL_RETAIN_DAYS` | How many days of attempt files a restart reads back, one to a year, seven by default |
|
|
367
|
+
| `EXECUTOR_READY_REQUIRES_NO_UNKNOWN_ATTEMPTS` | `true` keeps `/ready` at 503 while any attempt's outcome is unknown |
|
|
368
|
+
| `EXECUTOR_HALT_FILE` | Optional: a file whose presence halts the executor, watched and polled |
|
|
369
|
+
| `EXECUTOR_HALT_ON_AUTH_FAILURES` | `<count>/<seconds>` of door refusals that halt the executor; `50/60` by default |
|
|
370
|
+
| `EXECUTOR_HALT_ON_EGRESS_REFUSALS` | `<count>/<seconds>` of refused outbound requests that halt it; `5/60` by default |
|
|
371
|
+
| `EXECUTOR_HARD_LIMIT_SINGLE_MINOR` | `CHF:2500000000,EUR:1000000`: the most one action may move, per currency, in minor units |
|
|
372
|
+
| `EXECUTOR_HARD_LIMIT_WINDOW_SECONDS` | The window the count and sum below are measured over; required with either |
|
|
373
|
+
| `EXECUTOR_HARD_LIMIT_WINDOW_COUNT` | Optional: the most actions that may execute inside the window |
|
|
374
|
+
| `EXECUTOR_HARD_LIMIT_WINDOW_SUM_MINOR` | Optional: the most value that may move inside the window, in minor units |
|
|
375
|
+
| `EXECUTOR_MAX_CLOCK_SKEW_MS` | How far the authority's clock may differ before the executor halts; two seconds by default |
|
|
376
|
+
| `EXECUTOR_AUDIT_CHECKPOINT_LINES` | How many chained lines between persisted heads, one hundred by default |
|
|
377
|
+
| `EXECUTOR_EVIDENCE_DIR` | Where an operator's evidence bundle is written; exporting is refused with `409` when absent |
|
|
378
|
+
| `EXECUTOR_EVIDENCE_WINDOW_LINES` | Lines of each stream this process keeps for a bundle, 100 to 200000, five thousand by default |
|
|
379
|
+
| `EXECUTOR_EVIDENCE_SIGNING_KEY` | Optional Ed25519 PKCS#8 key that signs a bundle's manifest; secret, and needs an evidence directory |
|
|
380
|
+
| `EXECUTOR_IMAGE_DIGEST` | What the platform says this deployment is running; carried into a bundle and marked not self-verified |
|
|
381
|
+
| `EXECUTOR_DECISION_AUTHORITY` | `hosted` (the default): Decionis decides every intent. `edge`: the edge evaluator decides locally |
|
|
382
|
+
| `EXECUTOR_EDGE_WASM_PATH` | `edge` only: the evaluator module (ABI 3), licensed separately; the executor refuses to start without it |
|
|
383
|
+
| `EXECUTOR_EDGE_ORG_ID` | `edge` only: the Decionis organisation the policy bundles are issued to |
|
|
384
|
+
| `EXECUTOR_EDGE_BUNDLE_SOURCE`, `_FILE` | `url` (the default) fetches bundles from Decionis; `file` reads `EXECUTOR_EDGE_BUNDLE_FILE` |
|
|
385
|
+
| `EXECUTOR_EDGE_REFRESH_SECONDS` | The routine bundle refresh, one minute to a day, an hour by default |
|
|
386
|
+
| `EXECUTOR_EDGE_ON_UNAVAILABLE` | `hosted` (the default) asks Decionis when there is no usable bundle; `block` refuses |
|
|
387
|
+
| `EXECUTOR_EDGE_REPLAY_STORE` | `memory` (the default) or `postgres`: where single use is held; several replicas need `postgres` |
|
|
388
|
+
| `EXECUTOR_EDGE_SINGLE_REPLICA` | `true` is required with `memory`: the deployment's statement that it runs one replica |
|
|
389
|
+
| `EXECUTOR_EDGE_REPLAY_DATABASE_URL`, `_TABLE` | `postgres` only: the connection string (secret) and the claims table, `agentsafe_edge_replay` by default |
|
|
390
|
+
| `EXECUTOR_EDGE_INSTALLATION_ID` | The installation a usage report names, one per evidence chain; generated and kept in the journal when absent |
|
|
391
|
+
| `EXECUTOR_EDGE_USAGE_SIGNING_KEY`, `_KEY_ID` | Ed25519 PKCS#8 key monthly usage reports are signed with (secret), and its `kid`; without it a licence warning stands |
|
|
392
|
+
| `EXECUTOR_EDGE_USAGE_REPORT_DIR` | `file` source only: where signed usage reports are written for an operator to upload |
|
|
393
|
+
| `EXECUTOR_CARD_HOLDS_STORE` | `memory` (the default) or `postgres`: where card holds and claims live; several replicas, or holds across a restart, need `postgres` |
|
|
394
|
+
| `EXECUTOR_CARD_HOLDS_NAMESPACE` | `postgres` only, required: whose holds these are; two deployments on one database never see each other's |
|
|
395
|
+
| `EXECUTOR_CARD_HOLDS_DATABASE_URL`, `_TABLE` | `postgres` only: the connection string (secret) and the tables' prefix, `agentsafe_card` by default |
|
|
396
|
+
| `EXECUTOR_CARD_HOLDS_KEY` | `postgres` only: 32 bytes, hex or base64 (secret), under which what a row keeps of a grant is sealed |
|
|
397
|
+
| `EXECUTOR_CARD_AUTHORIZATIONS` | `single` (the default): one amount per authorization id. `incremental`: the same id may be re-presented for more, up to the ceiling |
|
|
398
|
+
| `EXECUTOR_CARD_NO_GRANT` | `no_match` (the default): an authorization with no hold is `NO_GRANT`. `evaluate`: it is evaluated at the commit boundary, held and claimed on an `ALLOW`, `PENDING` on an `ESCALATE` |
|
|
399
|
+
| `EXECUTOR_CARD_COMMIT_TENANT_ID`, `_ACTOR_ID`, `_ACTOR_TYPE` | `evaluate` only, the first two required: the tenant and actor (`SYSTEM` by default) a commit-boundary evaluation is captured as |
|
|
400
|
+
| `EXECUTOR_EDGE_ENTITLEMENT_FILE`, `EXECUTOR_EDGE_JWKS_FILE` | `file` source only: the signed entitlement and the pinned Decionis JWKS it is verified against |
|
|
401
|
+
| `DECIONIS_API_URL` | The authority, HTTPS |
|
|
402
|
+
| `DECIONIS_API_KEY` | The server-side Decionis credential; secret |
|
|
403
|
+
| `DECIONIS_ALLOW_INSECURE_LOOPBACK` | `true` permits plain HTTP to loopback for local doubles; refused under `NODE_ENV=production` |
|
|
404
|
+
| `DECIONIS_CA_FILE`, `DECIONIS_SPKI_PINS` | Optional: the PEM bundle the authority is verified against, and two or more `sha256/<base64>` SPKI pins |
|
|
405
|
+
| `PRESENCE_APPROVER_ID` | The person who must approve (`DIRECT` and `MANAGED`); `PRESENCE_APPROVER_ROLE` is optional in `MANAGED` |
|
|
406
|
+
| `PRESENCE_VERIFICATION_LEVEL`, `_METHODS` | `STANDARD` or `HIGH_CONFIDENCE`, and a comma-separated list of `WEBAUTHN`, `ACTIVE_LIVENESS` |
|
|
407
|
+
| `PRESENCE_API_URL`, `PRESENCE_API_KEY` | `DIRECT` only: the Presence service and its server-side credential; secret |
|
|
408
|
+
| `PRESENCE_ORGANIZATION` | `DIRECT` only: the requesting party the person sees |
|
|
409
|
+
| `PRESENCE_CA_FILE` | `DIRECT` only, optional: the PEM bundle the Presence service is verified against |
|
|
410
|
+
| `PRESENCE_HARDWARE_PKI_REQUIRED`, `_DISALLOW_VIRTUAL_CAMERAS` | `DIRECT` only: `true` or `false` |
|
|
411
|
+
| `DOWNSTREAM_URL` | Where the reference handler forwards the verified parameters, HTTPS |
|
|
412
|
+
| `DOWNSTREAM_LOOKUP_URL` | Optional read-only lookup for reconciliation; must contain `{idempotency_key}` |
|
|
413
|
+
| `DOWNSTREAM_SYSTEM`, `_OPERATION`, `_ENVIRONMENT` | The downstream target the intent names |
|
|
414
|
+
| `DOWNSTREAM_CREDENTIAL_KIND` | `STATIC_HEADER` (the default), `PRIVATE_KEY_JWT` or `SIGNED_REQUEST`; the other kinds' keys must be absent |
|
|
415
|
+
| `DOWNSTREAM_CREDENTIAL` | `STATIC_HEADER`: the header value the downstream expects, prefix included; secret |
|
|
416
|
+
| `DOWNSTREAM_CREDENTIAL_HEADER` | `STATIC_HEADER`: the header it goes in |
|
|
417
|
+
| `DOWNSTREAM_TOKEN_URL`, `DOWNSTREAM_CLIENT_ID` | `PRIVATE_KEY_JWT`: the token endpoint, HTTPS, and the client id |
|
|
418
|
+
| `DOWNSTREAM_PRIVATE_KEY` | `PRIVATE_KEY_JWT`: the PKCS#8 key the assertion is signed with; secret |
|
|
419
|
+
| `DOWNSTREAM_PRIVATE_KEY_ID`, `_ALGORITHM` | `PRIVATE_KEY_JWT`: optional `kid`, and `ES256` (the default) or `PS256` |
|
|
420
|
+
| `DOWNSTREAM_TOKEN_AUDIENCE`, `DOWNSTREAM_TOKEN_SCOPE` | `PRIVATE_KEY_JWT`: optional assertion audience (the token endpoint by default) and scope |
|
|
421
|
+
| `DOWNSTREAM_SIGNING_KEY`, `DOWNSTREAM_SIGNING_KEY_ID` | `SIGNED_REQUEST`: the Ed25519 PKCS#8 key or the HMAC secret, and the `keyid` the downstream knows it by; the key is secret |
|
|
422
|
+
| `DOWNSTREAM_SIGNING_ALGORITHM` | `SIGNED_REQUEST`: `ed25519` (the default) or `hmac-sha256` |
|
|
423
|
+
| `DOWNSTREAM_CA_FILE`, `DOWNSTREAM_SPKI_PINS` | Optional: the PEM bundle the downstream is verified against, and two or more `sha256/<base64>` SPKI pins |
|
|
424
|
+
| `DOWNSTREAM_TIMEOUT_MS` | Finite, at most fifteen seconds |
|
|
425
|
+
| `DOWNSTREAM_LOOKUP_BY_REFERENCE_URL` | Optional read-back by the provider's own reference; must contain `{provider_reference}` |
|
|
426
|
+
| `BANKING_ADAPTER_ID`, `BANKING_ADAPTER_VERSION` | The observer identity the effect evidence names; `AGENTSAFE_CORE_BANKING` and `0.1.0` by default |
|
|
427
|
+
| `EXECUTOR_ON_EFFECT_MISMATCH` | `HALT` (the default) or `ALERT`: what an observed effect that is not the authorised one does |
|
|
428
|
+
|
|
429
|
+
### The edge evaluator
|
|
430
|
+
|
|
431
|
+
With `EXECUTOR_DECISION_AUTHORITY=edge`, the executor decides each intent locally with the
|
|
432
|
+
Decionis edge evaluator: a WebAssembly module, licensed separately and not part of this package,
|
|
433
|
+
that evaluates the same binding hosted `enforce-and-bind` receives against a policy bundle Decionis
|
|
434
|
+
signed, and gives the same verdict. An `ALLOW` becomes a local authorization the executor consumes
|
|
435
|
+
once; a `BLOCK` is refused; an `ESCALATE` goes to Decionis, so `DIRECT` and `MANAGED` escalation
|
|
436
|
+
work as they do hosted. With no usable bundle the executor asks Decionis, or refuses under
|
|
437
|
+
`EXECUTOR_EDGE_ON_UNAVAILABLE=block`. Each local decision is an `EDGE_DECISION` line on the
|
|
438
|
+
evidence stream, counted into a signed monthly usage report. Single use holds in the process unless
|
|
439
|
+
the deployment names the shared Postgres store, which several replicas need. The executor reads the
|
|
440
|
+
signed entitlement and warns (a security event and a metric) when it is missing, expired, excludes
|
|
441
|
+
the edge or is exceeded, or a report is overdue; no licence condition ever stops or changes a
|
|
442
|
+
decision. Without the variable, or without the module, nothing changes: Decionis decides, as it
|
|
443
|
+
always has. How a deployment runs it, how bundles refresh, what expiry does, replicas, usage reports
|
|
444
|
+
and air-gapped operation are in
|
|
445
|
+
[the edge evaluator](https://github.com/decionis/agent-safe-pipeline/blob/master/docs/edge-evaluator.md).
|
|
362
446
|
|
|
363
447
|
## Principals
|
|
364
448
|
|
|
@@ -405,7 +489,8 @@ the token, a certificate is named by its SAN URI, a workload token by its issuer
|
|
|
405
489
|
|
|
406
490
|
A `PROPOSER` carries the tenant and actor its intents name and the actions it may propose; an
|
|
407
491
|
`OPERATOR` carries scopes from `halt`, `resume`, `secrets.reload`, `status`, `metrics`,
|
|
408
|
-
`evidence
|
|
492
|
+
`evidence`, `cards.authorize`; the last is the card issuer's authorization hook, and should be the
|
|
493
|
+
only scope its principal holds. The tenant and actor come from the principal, never from the request, and the
|
|
409
494
|
principal's id travels inside the hashed intent as `context.caller_principal`, so the authority's
|
|
410
495
|
policy can see who asked and a reconciliation or a resumption is refused unless the intent
|
|
411
496
|
presented is the caller's own (`403 INTENT_PRINCIPAL_MISMATCH`). An action a principal may not
|
|
@@ -579,7 +664,8 @@ key the organisation registered for the provider (`POST /v1/execution/provider-k
|
|
|
579
664
|
with the commit evidence whether or not it verified, and reads a verified receipt with an effect
|
|
580
665
|
digest as `SIGNED_RECEIPT` effect evidence when the grant named the effect it expected. A receipt
|
|
581
666
|
is never a reason for the authority to refuse a finalization; `effectReport` says what the
|
|
582
|
-
authority made of it.
|
|
667
|
+
authority made of it. An adapter whose answer is indeterminate passes the receipt it read as the
|
|
668
|
+
third argument of `IndeterminateOutcome`, so a signed receipt on a 5xx still reaches the authority.
|
|
583
669
|
|
|
584
670
|
The effect plane reads what a receipt _states_, and only to compare it. An adapter's transport
|
|
585
671
|
carries the header's value on its `ProviderResult` (`CoreBankingHttpAdapter` does), and the effect
|
|
@@ -733,8 +819,16 @@ one that leaves the origin is reported; the body is read whole under
|
|
|
733
819
|
the verifier, the Presence transport and the handlers take from a fetch. Every refusal is
|
|
734
820
|
`EGRESS_REFUSED` on the security stream with the origin and a code, `EGRESS_ORIGIN_NOT_ALLOWED`,
|
|
735
821
|
`EGRESS_SCHEME_NOT_ALLOWED`, `EGRESS_PATH_NOT_ALLOWED`, `EGRESS_ADDRESS_REFUSED`,
|
|
736
|
-
`EGRESS_TLS_REJECTED
|
|
737
|
-
|
|
822
|
+
`EGRESS_TLS_REJECTED` (a handshake that failed), `EGRESS_TLS_CLIENT_CERT_REFUSED` (the peer
|
|
823
|
+
refused the client certificate this process never presents), `EGRESS_TLS_PIN_MISMATCH`,
|
|
824
|
+
`EGRESS_BODY_TOO_LARGE`, `EGRESS_TIMEOUT`, `EGRESS_REDIRECT_REFUSED`, `EGRESS_RESPONSE_INVALID` or
|
|
825
|
+
`EGRESS_INIT_UNSUPPORTED`, and is counted. A TLS failure after a verified handshake is not a
|
|
826
|
+
refusal: it broke a connection that may have carried the request, so the connection's own error
|
|
827
|
+
passes through to the caller. It is still reported, as `EGRESS_REFUSED` with `EGRESS_TLS_BROKEN`,
|
|
828
|
+
and counts toward the refusal spike that halts the executor, as it did when it was reported as a
|
|
829
|
+
rejected handshake: records that break a verified session are an attack until shown otherwise.
|
|
830
|
+
A gateway's public-only upstream is the one exception, since its TLS is its owner's to fix: a
|
|
831
|
+
refused handshake there is `UPSTREAM_TLS_REFUSED` instead, and a broken session is not reported.
|
|
738
832
|
|
|
739
833
|
Three layers hold this: the wiring, which hands the guarded fetch to every component and to the
|
|
740
834
|
handler seam; the global `fetch`, which `serve` replaces at start with one that refuses and makes
|
|
@@ -911,6 +1005,87 @@ than the transport. What the executor implements of the profile, and what it doe
|
|
|
911
1005
|
the confirmation states and the mismatch behaviour are in
|
|
912
1006
|
[execution outcomes](https://github.com/decionis/agent-safe-pipeline/blob/master/docs/execution-outcomes.md).
|
|
913
1007
|
|
|
1008
|
+
### The cards family
|
|
1009
|
+
|
|
1010
|
+
`cardHandlers()` registers `card.purchase`. A live card authorization has to be answered in
|
|
1011
|
+
milliseconds and cannot wait for a person, so the decision, and any cardholder tap, happens before
|
|
1012
|
+
the agent presents the card, and the issuer's real-time authorization hook later matches the
|
|
1013
|
+
authorization to the grant the decision left:
|
|
1014
|
+
|
|
1015
|
+
1. The agent proposes `card.purchase` with `{ cardTokenRef, amountMinor, currency, merchantId,
|
|
1016
|
+
mcc? }` and the target `card:<cardTokenRef>`. The card is named by its token reference, never by
|
|
1017
|
+
its number: anything shaped like a card number (13 to 19 digits passing Luhn, contiguous or
|
|
1018
|
+
grouped) is refused with `422 CARD_PAN_REFUSED` before the intent is captured. The amount is a
|
|
1019
|
+
ceiling in minor units of a currency this build knows the exponent of.
|
|
1020
|
+
2. On an `ALLOW` the grant is held, not claimed: the answer is `outcome: "HELD_FOR_AUTHORIZATION"`,
|
|
1021
|
+
`executed: false`, with the grant's expiry in `result.expires_at`. Holds are keyed by the card
|
|
1022
|
+
and the merchant: one card has at most one spendable hold per merchant, so a second purchase at
|
|
1023
|
+
the same merchant is `409 CARD_GRANT_ALREADY_HELD` until the first is authorised or expires,
|
|
1024
|
+
while purchases at other merchants hold in parallel. An `ESCALATE` resumes with an attestation,
|
|
1025
|
+
as above.
|
|
1026
|
+
3. The issuer's hook posts `{ authorization_id, card_token_ref, amount_minor, currency,
|
|
1027
|
+
merchant_id, mcc? }` to `/v1/card-authorizations`. The hold is found by the card and the merchant
|
|
1028
|
+
the authorization names, the match is pure, and the claim is the only network call: same
|
|
1029
|
+
currency, same category when the purchase named one, an amount at or below the grant, and a
|
|
1030
|
+
grant unexpired and unspent. A match claims the grant through the authority exactly once and
|
|
1031
|
+
answers `{ decision: "APPROVE", intent_id, intent_hash, decision_id, dossier_id, grant_id,
|
|
1032
|
+
lease_expires_at }`; anything else answers `{ decision: "NO_MATCH", code }` with `NO_GRANT`
|
|
1033
|
+
(none held for this card at this merchant), `GRANT_ALREADY_USED`, `GRANT_EXPIRED`,
|
|
1034
|
+
`CURRENCY_MISMATCH`, `MCC_MISMATCH`, `AMOUNT_EXCEEDS_GRANT`, `AUTHORIZATION_ID_REUSED`,
|
|
1035
|
+
`GRANT_CLAIM_REFUSED`, `JOURNAL_UNAVAILABLE`, `CARD_HOLDS_UNAVAILABLE`, `EXECUTOR_HALTED`,
|
|
1036
|
+
`POSTURE_DEGRADED` or `CARD_AUTHORIZATION_CAPACITY_EXCEEDED`. What a `NO_MATCH` means for the
|
|
1037
|
+
purchase is the issuer's own policy. Concurrent identical requests share one claim and answer.
|
|
1038
|
+
Reusing an authorization id for a different request is refused before another card's grant can
|
|
1039
|
+
be claimed, unless the issuer may increment: with `EXECUTOR_CARD_AUTHORIZATIONS=incremental`,
|
|
1040
|
+
the same id re-presented for a higher amount, within the ceiling and before its result, is
|
|
1041
|
+
answered from the same claim (`CARD_AUTHORIZATION_INCREMENTED`), and the result records the
|
|
1042
|
+
final amount. At most 10,000 distinct authorization ids can be in flight per process. A
|
|
1043
|
+
completed approval is cached for retry while its record is retained. With
|
|
1044
|
+
`EXECUTOR_CARD_NO_GRANT=evaluate`, an authorization with no hold is not `NO_GRANT` but
|
|
1045
|
+
evaluated at the commit boundary as a `card.purchase` intent of the commit actor the deployment
|
|
1046
|
+
names: an `ALLOW` is held and claimed in the same call, an `ESCALATE` is answered
|
|
1047
|
+
`{ decision: "PENDING", intent_id, intent_hash, decision_id, dossier_id, expires_at, escalation }`
|
|
1048
|
+
for a platform that can pend until the tap arrives through `POST /v1/escalations` (presented by
|
|
1049
|
+
the issuer app's backend, an operator with `escalations.resume`) and the authorization is
|
|
1050
|
+
re-presented (`CARD_AUTHORIZATION_PENDING`), and a `BLOCK` is `NO_MATCH` with `POLICY_BLOCK`.
|
|
1051
|
+
The three places a tap can wait, and which of Koard's taps each is, are in
|
|
1052
|
+
[the card authorization guide](../../docs/banking/card-authorization.md#the-three-places-a-tap-can-wait).
|
|
1053
|
+
4. The hook posts `{ status: "APPROVED" | "DECLINED", approved_amount_minor?, auth_code? }` to
|
|
1054
|
+
`/v1/card-authorizations/{authorization_id}/result`. An approval finalizes the grant
|
|
1055
|
+
`COMMITTED` with the effect compared against the grant (inside the ceiling is a match; above it
|
|
1056
|
+
is `EFFECT_MISMATCH`, which halts by default); a decline finalizes `FAILED`; a result after the
|
|
1057
|
+
claim's lease finalizes `INDETERMINATE` with `CLAIM_LEASE_EXPIRED`, because the authority no
|
|
1058
|
+
longer takes a commit for it. A result is recorded once.
|
|
1059
|
+
|
|
1060
|
+
Holds live in memory by default, bounded, for no longer than their grant; a restart loses only
|
|
1061
|
+
grants nobody claimed, which expire with no effect, and that is right for exactly one replica. A
|
|
1062
|
+
deployment with several replicas, or one that must keep its holds across a restart, sets
|
|
1063
|
+
`EXECUTOR_CARD_HOLDS_STORE=postgres`: holds and claims become rows every replica shares, unique on
|
|
1064
|
+
the card and the merchant, and the database decides each race in one statement, so of two
|
|
1065
|
+
purchases racing for the same key one holds, and of two authorizations racing for the same hold
|
|
1066
|
+
one claims, exactly as in memory. What a row keeps of a grant, and later of the claim, is sealed
|
|
1067
|
+
under `EXECUTOR_CARD_HOLDS_KEY` (32 bytes, hex or base64, a secret) with the row's own identity
|
|
1068
|
+
as associated data, so the database holds no bearer credential in clear and a row moved elsewhere
|
|
1069
|
+
does not open. A hold another replica made is admitted on first use through the executor's own
|
|
1070
|
+
checks (`GRANT_HELD` with `HOLD_ADOPTED`), and a claim another replica made is settled with the
|
|
1071
|
+
claim material that replica sealed, so the issuer's hook and its result may reach any replica.
|
|
1072
|
+
`agentsafe cards holds-schema [--table <prefix>]` prints the DDL; the operator creates the three
|
|
1073
|
+
tables once, the executor probes them at start and sweeps them hourly, and
|
|
1074
|
+
`EXECUTOR_CARD_HOLDS_NAMESPACE` keeps two deployments on one database apart. Each card purchase's
|
|
1075
|
+
intent context carries
|
|
1076
|
+
`card_velocity: { window_seconds: 600, holds, claims }`, how many purchases this process held for
|
|
1077
|
+
the same card and how many authorizations claimed one in the last ten minutes, counted here because
|
|
1078
|
+
the policy language counts nothing over time: a rule can hold a burst for the cardholder's tap. The
|
|
1079
|
+
numbers are part of the hashed intent; the card reference is not among them. A claimed authorization is journaled before the issuer is
|
|
1080
|
+
told to approve, and one whose result never arrives stays an open, unknown attempt, because the
|
|
1081
|
+
executor has no read path into the issuer's ledger. The security stream carries
|
|
1082
|
+
`CARD_GRANT_HELD`, `CARD_AUTHORIZATION_MATCHED`, `CARD_AUTHORIZATION_INCREMENTED`,
|
|
1083
|
+
`CARD_AUTHORIZATION_NO_MATCH` with its code, `CARD_AUTHORIZATION_SETTLED` with the outcome, and
|
|
1084
|
+
`CARD_CLAIM_RECORD_FAILED` when the shared store could not keep a claim: intent ids and codes,
|
|
1085
|
+
never a card reference, an amount or a merchant. The card path's own cost is measured in
|
|
1086
|
+
`test/performance`; what the hook's latency is in a deployment is in
|
|
1087
|
+
[the card authorization guide](../../docs/banking/card-authorization.md#latency).
|
|
1088
|
+
|
|
914
1089
|
## The image
|
|
915
1090
|
|
|
916
1091
|
```bash
|
package/dist/Cli.js
CHANGED
|
@@ -21,8 +21,12 @@ import { join } from "node:path";
|
|
|
21
21
|
import process from "node:process";
|
|
22
22
|
import { nodeCliProcess } from "./cli/CliProcess.js";
|
|
23
23
|
import { isGatewayCommand, runGatewayCommand } from "./cli/Commands.js";
|
|
24
|
+
import { runCards } from "./cli/Cards.js";
|
|
25
|
+
import { runEdge } from "./cli/Edge.js";
|
|
24
26
|
import { usage } from "./cli/Help.js";
|
|
25
27
|
import { runVerifyIntent } from "./cli/VerifyIntent.js";
|
|
28
|
+
import { runTcpBroker } from "./cli/TcpBrokerCli.js";
|
|
29
|
+
import { runConnector, runTunnel } from "./cli/TcpClientCli.js";
|
|
26
30
|
import { parseTarget, probeContainment } from "./containment/ContainmentProbe.js";
|
|
27
31
|
import { dial } from "./egress/TcpProbe.js";
|
|
28
32
|
import { serve } from "./Serve.js";
|
|
@@ -48,6 +52,11 @@ const COMMANDS = [
|
|
|
48
52
|
"verify-bundle",
|
|
49
53
|
"verify-intent",
|
|
50
54
|
"probe-containment",
|
|
55
|
+
"edge",
|
|
56
|
+
"cards",
|
|
57
|
+
"tcp-broker",
|
|
58
|
+
"connector",
|
|
59
|
+
"tunnel",
|
|
51
60
|
];
|
|
52
61
|
/**
|
|
53
62
|
* The whole entry is one function rather than top-level statements, because
|
|
@@ -79,6 +88,15 @@ async function main() {
|
|
|
79
88
|
else if (command === "serve") {
|
|
80
89
|
await serve();
|
|
81
90
|
}
|
|
91
|
+
else if (command === "tcp-broker") {
|
|
92
|
+
await runTcpBroker(nodeCliProcess(), rest);
|
|
93
|
+
}
|
|
94
|
+
else if (command === "connector") {
|
|
95
|
+
await runConnector(nodeCliProcess(), rest);
|
|
96
|
+
}
|
|
97
|
+
else if (command === "tunnel") {
|
|
98
|
+
await runTunnel(nodeCliProcess(), rest);
|
|
99
|
+
}
|
|
82
100
|
else if (command === "verify-chain") {
|
|
83
101
|
const source = rest[0];
|
|
84
102
|
const text = readFileSync(source === undefined ? 0 : source, "utf8");
|
|
@@ -120,6 +138,12 @@ async function main() {
|
|
|
120
138
|
process.stdout.write(`${JSON.stringify(report)}\n`);
|
|
121
139
|
process.exit(report.ok ? 0 : 1);
|
|
122
140
|
}
|
|
141
|
+
else if (command === "edge") {
|
|
142
|
+
await runEdge(nodeCliProcess(), rest);
|
|
143
|
+
}
|
|
144
|
+
else if (command === "cards") {
|
|
145
|
+
await runCards(nodeCliProcess(), rest);
|
|
146
|
+
}
|
|
123
147
|
else if (command === "verify-intent") {
|
|
124
148
|
runVerifyIntent(nodeCliProcess(), rest);
|
|
125
149
|
}
|
package/dist/Cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cli.js","sourceRoot":"","sources":["../src/Cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,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