@oxdeai/sdk 1.3.1 → 2.0.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/CHANGELOG.md CHANGED
@@ -7,6 +7,107 @@ This project follows Semantic Versioning.
7
7
 
8
8
  ---
9
9
 
10
+ ## [2.0.0] - Unreleased
11
+
12
+ **Baseline for this entry:** the published `@oxdeai/sdk@1.3.3` npm artifact
13
+ (2026-04-23), compared file-by-file against the current candidate.
14
+
15
+ > ⚠️ `1.3.3` was published and then further modified on `main` without a version
16
+ > bump: the published `dist/guard.js` and `dist/client.js` differ from the current
17
+ > source at the same version number. `2.0.0` restores the guarantee that a version
18
+ > identifies an artifact.
19
+
20
+ The SDK's own module list is unchanged. The major is not cosmetic dependency
21
+ tracking — it reflects two real consumer-visible changes plus the re-exported core
22
+ surface.
23
+
24
+ ### Breaking
25
+
26
+ - **`export * from "@oxdeai/core"` re-exports core's 2.0 surface.** Every core
27
+ breaking change is therefore an SDK breaking change for consumers importing
28
+ `PolicyEngine` and friends from `@oxdeai/sdk`. See the `@oxdeai/core` 2.0.0 entry
29
+ — in particular the required `evaluationTime` argument and the now-required
30
+ `maxClockSkewSeconds` / `maxIntentAgeSeconds` engine options.
31
+ - **`Authorization` is replaced by `AuthorizationV1`** in the public type surface of
32
+ `client.d.ts`, `guard.d.ts` and `types.d.ts`. Code that annotated these values with
33
+ the internal `Authorization` type no longer compiles.
34
+
35
+ ### Security hardening
36
+
37
+ - **Verifier time is taken from the trusted clock, never from `intent.timestamp`.**
38
+ Previously `OxDeAIClient.verifyAuthorization` and the SDK guard passed
39
+ `intent.timestamp` as "now". Because that value is proposer-supplied and
40
+ hash-bound into the authorization at issuance, the expiry comparison was pinned to
41
+ issuance time and **the authorization never expired**. Both paths now sample the
42
+ clock boundary once per evaluation and reuse that single sample for the timestamp
43
+ fallback, for `evaluationTime`, and for verification.
44
+
45
+ This changes runtime behaviour for existing callers: artifacts that previously
46
+ verified indefinitely will now correctly be rejected once expired.
47
+
48
+ Note that the SDK clock defaults to `Date.now() / 1000` unless the caller supplies
49
+ an independent `ClockAdapter`. A supplied value is not automatically independently
50
+ trusted time.
51
+
52
+ ### Added
53
+
54
+ - `OxDeAIClient.verifyAuthorization` accepts an optional third argument
55
+ `{ verificationTime?: number }` for callers that already hold a verification time
56
+ from their trusted execution boundary. Additive; existing two-argument calls
57
+ continue to work.
58
+
59
+ ### Changed
60
+
61
+ - `OxDeAIClient.verifyAuthorization` documents that it inherits the **limited scope**
62
+ of `PolicyEngine.verifyAuthorization`: it authenticates only the engine-HMAC field
63
+ subset. Relying parties enforcing an authorization issued by an external party must
64
+ use the strict standalone verifier with explicit `trustedKeySets`.
65
+
66
+ ### Packaging
67
+
68
+ - `license`, `repository` (with `directory`), `homepage` and `bugs` are now declared;
69
+ the published `1.3.3` artifact carried none of them, which blocks npm provenance.
70
+ - `prepack` now rebuilds before packing.
71
+
72
+ ---
73
+
74
+ ## 1.3.3
75
+
76
+ - Fix package publish contents: exclude src and test artifacts from the published tarball.
77
+
78
+ ## [1.3.2] - 2026-03-30
79
+
80
+ ### Security
81
+
82
+ - `engine_secret` minimum-length and entropy requirements now enforced at runtime — insecure defaults removed.
83
+ - Timing-safe HMAC comparison (`timingSafeEqual`) applied in domain verification.
84
+
85
+ ### Added
86
+
87
+ - Explicit verifier trust boundary with strict-mode enforcement in the trust model.
88
+ - DelegationV1 protocol artifact: full implementation, verification, and conformance vectors (139 assertions).
89
+
90
+ ### Fixed
91
+
92
+ - `deepMerge` is now non-mutating; property-based tests added.
93
+ - `tool_limits` marked required in `State` type, aligning type with runtime behavior.
94
+ - PolicyEngine output types exported; decision-path property surfaced correctly.
95
+ - TypeScript type error for `engine_secret` resolved across examples and packages.
96
+ - Conformance vectors regenerated with 32-char secret and CI environment aligned.
97
+
98
+ ### Changed
99
+
100
+ - Protocol-stack version alignment with:
101
+ - `@oxdeai/core@1.6.1`
102
+ - `@oxdeai/conformance@1.4.0`
103
+ - Trust boundary made explicit across SDK and documentation.
104
+
105
+ ### Notes
106
+
107
+ - `@oxdeai/cli` remains on a separate tooling version line.
108
+
109
+ ---
110
+
10
111
  ## [1.3.1] - 2026-03-08
11
112
 
12
113
  ### Changed
package/LICENSE ADDED
@@ -0,0 +1,213 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+
9
+ 1. Definitions.
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+ "License" shall mean the terms and conditions for use, reproduction,
13
+ and distribution as defined by Sections 1 through 9 of this document.
14
+
15
+ "Licensor" shall mean the copyright owner or entity authorized by
16
+ the copyright owner that is granting the License.
17
+
18
+ "Legal Entity" shall mean the union of the acting entity and all
19
+ other entities that control, are controlled by, or are under common
20
+ control with that entity. For the purposes of this definition,
21
+ "control" means (i) the power, direct or indirect, to cause the
22
+ direction or management of such entity, whether by contract or
23
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
24
+ outstanding shares, or (iii) beneficial ownership of such entity.
25
+
26
+ "You" (or "Your") shall mean an individual or Legal Entity
27
+ exercising permissions granted by this License.
28
+
29
+ "Source" form shall mean the preferred form for making modifications,
30
+ including but not limited to software source code, documentation
31
+ source, and configuration files.
32
+
33
+ "Object" form shall mean any form resulting from mechanical
34
+ transformation or translation of a Source form, including but
35
+ not limited to compiled object code, generated documentation,
36
+ and conversions to other media types.
37
+
38
+ "Work" shall mean the work of authorship, whether in Source or
39
+ Object form, made available under the License, as indicated by a
40
+ copyright notice that is included in or attached to the work
41
+ (an example is provided in the Appendix below).
42
+
43
+ "Derivative Works" shall mean any work, whether in Source or Object
44
+ form, that is based on (or derived from) the Work and for which the
45
+ editorial revisions, annotations, elaborations, or other modifications
46
+ represent, as a whole, an original work of authorship. For the purposes
47
+ of this License, Derivative Works shall not include works that remain
48
+ separable from, or merely link (or bind by name) to the interfaces of,
49
+ the Work and Derivative Works thereof.
50
+
51
+ "Contribution" shall mean any work of authorship, including
52
+ the original version of the Work and any modifications or additions
53
+ to that Work or Derivative Works thereof, that is intentionally
54
+ submitted to Licensor for inclusion in the Work by the copyright owner
55
+ or by an individual or Legal Entity authorized to submit on behalf of
56
+ the copyright owner. For the purposes of this definition, "submitted"
57
+ means any form of electronic, verbal, or written communication sent
58
+ to the Licensor or its representatives, including but not limited to
59
+ communication on electronic mailing lists, source code control systems,
60
+ and issue tracking systems that are managed by, or on behalf of, the
61
+ Licensor for the purpose of discussing and improving the Work, but
62
+ excluding communication that is conspicuously marked or otherwise
63
+ designated in writing by the copyright owner as "Not a Contribution."
64
+
65
+ "Contributor" shall mean Licensor and any individual or Legal Entity
66
+ on behalf of whom a Contribution has been received by Licensor and
67
+ subsequently incorporated within the Work.
68
+
69
+ 2. Grant of Copyright License. Subject to the terms and conditions of
70
+ this License, each Contributor hereby grants to You a perpetual,
71
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
72
+ copyright license to reproduce, prepare Derivative Works of,
73
+ publicly display, publicly perform, sublicense, and distribute the
74
+ Work and such Derivative Works in Source or Object form.
75
+
76
+ 3. Grant of Patent License. Subject to the terms and conditions of
77
+ this License, each Contributor hereby grants to You a perpetual,
78
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
79
+ (except as stated in this section) patent license to make, have made,
80
+ use, offer to sell, sell, import, and otherwise transfer the Work,
81
+ where such license applies only to those patent claims licensable
82
+ by such Contributor that are necessarily infringed by their
83
+ Contribution(s) alone or by combination of their Contribution(s)
84
+ with the Work to which such Contribution(s) was submitted. If You
85
+ institute patent litigation against any entity (including a
86
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
87
+ or a Contribution incorporated within the Work constitutes direct
88
+ or contributory patent infringement, then any patent licenses
89
+ granted to You under this License for that Work shall terminate
90
+ as of the date such litigation is filed.
91
+
92
+ 4. Redistribution. You may reproduce and distribute copies of the
93
+ Work or Derivative Works thereof in any medium, with or without
94
+ modifications, and in Source or Object form, provided that You
95
+ meet the following conditions:
96
+
97
+ (a) You must give any other recipients of the Work or
98
+ Derivative Works a copy of this License; and
99
+
100
+ (b) You must cause any modified files to carry prominent notices
101
+ stating that You changed the files; and
102
+
103
+ (c) You must retain, in the Source form of any Derivative Works
104
+ that You distribute, all copyright, patent, trademark, and
105
+ attribution notices from the Source form of the Work,
106
+ excluding those notices that do not pertain to any part of
107
+ the Derivative Works; and
108
+
109
+ (d) If the Work includes a "NOTICE" text file as part of its
110
+ distribution, then any Derivative Works that You distribute must
111
+ include a readable copy of the attribution notices contained
112
+ within such NOTICE file, excluding those notices that do not
113
+ pertain to any part of the Derivative Works, in at least one
114
+ of the following places: within a NOTICE text file distributed
115
+ as part of the Derivative Works; within the Source form or
116
+ documentation, if provided along with the Derivative Works; or,
117
+ within a display generated by the Derivative Works, if and
118
+ wherever such third-party notices normally appear. The contents
119
+ of the NOTICE file are for informational purposes only and
120
+ do not modify the License. You may add Your own attribution
121
+ notices within Derivative Works that You distribute, alongside
122
+ or as an addendum to the NOTICE text from the Work, provided
123
+ that such additional attribution notices cannot be construed
124
+ as modifying the License.
125
+
126
+ You may add Your own copyright statement to Your modifications and
127
+ may provide additional or different license terms and conditions
128
+ for use, reproduction, or distribution of Your modifications, or
129
+ for any such Derivative Works as a whole, provided Your use,
130
+ reproduction, and distribution of the Work otherwise complies with
131
+ the conditions stated in this License.
132
+
133
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
134
+ any Contribution intentionally submitted for inclusion in the Work
135
+ by You to the Licensor shall be under the terms and conditions of
136
+ this License, without any additional terms or conditions.
137
+ Notwithstanding the above, nothing herein shall supersede or modify
138
+ the terms of any separate license agreement you may have executed
139
+ with Licensor regarding such Contributions.
140
+
141
+ 6. Trademarks. This License does not grant permission to use the trade
142
+ names, trademarks, service marks, or product names of the Licensor,
143
+ except as required for reasonable and customary use in describing the
144
+ origin of the Work and reproducing the content of the NOTICE file.
145
+
146
+ 7. Disclaimer of Warranty. Unless required by applicable law or
147
+ agreed to in writing, Licensor provides the Work (and each
148
+ Contributor provides its Contributions) on an "AS IS" BASIS,
149
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
150
+ implied, including, without limitation, any warranties or conditions
151
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
152
+ PARTICULAR PURPOSE. You are solely responsible for determining the
153
+ appropriateness of using or redistributing the Work and assume any
154
+ risks associated with Your exercise of permissions under this License.
155
+
156
+ 8. Limitation of Liability. In no event and under no legal theory,
157
+ whether in tort (including negligence), contract, or otherwise,
158
+ unless required by applicable law (such as deliberate and grossly
159
+ negligent acts) or agreed to in writing, shall any Contributor be
160
+ liable to You for damages, including any direct, indirect, special,
161
+ incidental, or consequential damages of any character arising as a
162
+ result of this License or out of the use or inability to use the
163
+ Work (including but not limited to damages for loss of goodwill,
164
+ work stoppage, computer failure or malfunction, or any and all
165
+ other commercial damages or losses), even if such Contributor
166
+ has been advised of the possibility of such damages.
167
+
168
+ 9. Accepting Warranty or Additional Liability. While redistributing
169
+ the Work or Derivative Works thereof, You may choose to offer,
170
+ and charge a fee for, acceptance of support, warranty, indemnity,
171
+ or other liability obligations and/or rights consistent with this
172
+ License. However, in accepting such obligations, You may act only
173
+ on Your own behalf and on Your sole responsibility, not on behalf
174
+ of any other Contributor, and only if You agree to indemnify,
175
+ defend, and hold each Contributor harmless for any liability
176
+ incurred by, or claims asserted against, such Contributor by reason
177
+ of your accepting any such warranty or additional liability.
178
+
179
+ END OF TERMS AND CONDITIONS
180
+
181
+ APPENDIX: How to apply the Apache License to your work.
182
+
183
+ To apply the Apache License to your work, attach the following
184
+ boilerplate notice, with the fields enclosed by brackets "[]"
185
+ replaced with your own identifying information. (Don't include
186
+ the brackets!) The text should be enclosed in the appropriate
187
+ comment syntax for the file format. We also recommend that a
188
+ file or class name and description of purpose be included on the
189
+ same "printed page" as the copyright notice for easier
190
+ identification within third-party archives.
191
+
192
+ Copyright [yyyy] [name of copyright owner]
193
+
194
+ Licensed under the Apache License, Version 2.0 (the "License");
195
+ you may not use this file except in compliance with the License.
196
+ You may obtain a copy of the License at
197
+
198
+ http://www.apache.org/licenses/LICENSE-2.0
199
+
200
+ Unless required by applicable law or agreed to in writing, software
201
+ distributed under the License is distributed on an "AS IS" BASIS,
202
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
203
+ See the License for the specific language governing permissions and
204
+ limitations under the License.
205
+
206
+
207
+ OxDeAI
208
+ Copyright 2026 OxDeAI contributors
209
+
210
+ This product includes software developed by the OxDeAI project
211
+ (https://github.com/oxdeai/oxdeai).
212
+
213
+
package/README.md CHANGED
@@ -1,10 +1,16 @@
1
1
  # @oxdeai/sdk
2
-
3
- Developer-facing integration layer on top of `@oxdeai/core`.
2
+ Developer toolkit for the OxDeAI execution-time authorization protocol (ETA).
3
+ Builds intents/states and guard boundaries that fail closed at execution.
4
4
 
5
5
  ## Status
6
6
 
7
- Current protocol stack line: **v1.3.x** (`@oxdeai/core`, `@oxdeai/sdk`, `@oxdeai/conformance`).
7
+ Release policy note: OxDeAI uses package-scoped versions and package-scoped tags. `@oxdeai/sdk` has its own package version line; coordinated release commits do not imply shared package versions across `core`, `sdk`, or `conformance`. See [`docs/release/RELEASE.md`](../../docs/release/RELEASE.md).
8
+
9
+ Current `@oxdeai/sdk` package line: **2.0.0**. `export * from "@oxdeai/core"`
10
+ re-exports core's 2.0 surface, so every core 2.0 breaking change (in particular
11
+ the required `evaluationTime` argument and the now-required
12
+ `maxClockSkewSeconds` / `maxIntentAgeSeconds` engine options) is a consumer-visible
13
+ change here too. See [`CHANGELOG.md`](./CHANGELOG.md) for the full list.
8
14
 
9
15
  The SDK is an integration surface and does not redefine protocol semantics.
10
16
 
@@ -15,9 +21,23 @@ The SDK is an integration surface and does not redefine protocol semantics.
15
21
  - Public guard API for callback-boundary enforcement (`createGuard`)
16
22
  - Runtime adapters (in-memory and file-based)
17
23
 
18
- ## Guard API (v1.3 adoption layer)
24
+ ## Architecture Overview
25
+
26
+ ![PDP and PEP flow](../../docs/diagrams/pdp-pep-flow.svg)
27
+
28
+ OxDeAI SDK sits at the runtime integration boundary:
29
+
30
+ - runtime/adapter proposes action input
31
+ - PDP evaluates policy and emits `AuthorizationV1` on `ALLOW`
32
+ - PEP callback gate executes only after authorization enforcement
19
33
 
20
- The SDK exposes a framework-agnostic guard boundary:
34
+ Diagram source/editing policy:
35
+ - [`docs/diagrams/README.md`](../../docs/diagrams/README.md)
36
+
37
+ ## Guard API
38
+
39
+ The SDK exposes its own framework-agnostic guard boundary, built directly on
40
+ `OxDeAIClient`'s in-process `stateAdapter`/`auditAdapter`/`clock`:
21
41
 
22
42
  ```ts
23
43
  const guard = createGuard({ engine, stateAdapter, auditAdapter, clock });
@@ -34,12 +54,27 @@ This keeps PDP/PEP separation explicit:
34
54
  - PDP: `PolicyEngine.evaluatePure(...)` decides
35
55
  - PEP: guard callback boundary enforces execute-or-refuse
36
56
 
57
+ **`createGuard` is not the canonical universal PEP.** It is a convenience
58
+ boundary scoped to the SDK's own in-process adapters, useful for prototypes,
59
+ scripts, and simple single-process integrations. It does not implement
60
+ versioned/CAS state commits, a pluggable replay store, delegation, or trusted
61
+ execution-context provenance reconciliation.
62
+
63
+ **[`@oxdeai/guard`](../guard/README.md) is the dedicated enforcement-boundary
64
+ package for the 2.0 architecture.** `OxDeAIGuard` and the Tier 1
65
+ `createSecureGuard` path are what production deployments should use. It is a
66
+ separate package specifically so that every runtime adapter (LangGraph,
67
+ CrewAI, OpenAI Agents SDK, OpenClaw, custom agents) shares one PEP
68
+ implementation instead of each re-implementing this boundary. Prefer
69
+ `@oxdeai/guard` for anything beyond a single-process prototype; treat the
70
+ SDK's `createGuard` as the lower-level/legacy-compatible path it is.
71
+
37
72
  OxDeAI sits below agent frameworks (OpenAI tools, LangGraph, others) as the deterministic authorization boundary.
38
73
 
39
74
  ## Quick Example
40
75
 
41
76
  ```ts
42
- import { PolicyEngine } from "@oxdeai/core";
77
+ import { PolicyEngine, RECOMMENDED_TRUSTED_TIME_PROFILE } from "@oxdeai/core";
43
78
  import {
44
79
  OxDeAIClient,
45
80
  createGuard,
@@ -51,8 +86,9 @@ import {
51
86
 
52
87
  const engine = new PolicyEngine({
53
88
  policy_version: "v1",
54
- engine_secret: "dev-secret",
55
- authorization_ttl_seconds: 120
89
+ engine_secret: "example-secret-must-be-32-chars!",
90
+ authorization_ttl_seconds: 120,
91
+ ...RECOMMENDED_TRUSTED_TIME_PROFILE // maxClockSkewSeconds / maxIntentAgeSeconds: required, no default
56
92
  });
57
93
 
58
94
  const stateAdapter = new InMemoryStateAdapter(
@@ -97,10 +133,34 @@ await guard(intent, async () => {
97
133
  });
98
134
  ```
99
135
 
136
+ ## Verification Time
137
+
138
+ Authorization verification has two clock domains, and they are not interchangeable:
139
+
140
+ | Value | Trust |
141
+ | --- | --- |
142
+ | `intent.timestamp` | Untrusted. Supplied by the agent. |
143
+ | verifier time | Trusted. Supplied by the execution boundary. |
144
+
145
+ The SDK takes verifier time from the trusted `clock` passed to `OxDeAIClient` and `createGuard`,
146
+ never from the intent. A caller that already holds a trusted time from the execution boundary can
147
+ pass it explicitly:
148
+
149
+ ```ts
150
+ await client.verifyAuthorization(intent, authorization, {
151
+ verificationTime: trustedClock.now()
152
+ });
153
+ ```
154
+
155
+ Deriving verifier time from `intent.timestamp` compares an authorization against a deadline the
156
+ same untrusted value produced, so expiry can never be enforced. `clock` defaults to
157
+ `Date.now() / 1000`; supply a `ClockAdapter` when the host has an independently trusted time source.
158
+
100
159
  ## Main Exports
101
160
 
102
161
  - `buildIntent`, `buildState`
103
162
  - `OxDeAIClient`
163
+ - `createGuard`
104
164
  - `InMemoryStateAdapter`, `InMemoryAuditAdapter`
105
165
  - `JsonFileStateAdapter`, `NdjsonFileAuditAdapter`
106
166
 
package/dist/adapters.js CHANGED
@@ -1,3 +1,4 @@
1
+ // SPDX-License-Identifier: Apache-2.0
1
2
  import { appendFile, mkdir, readFile, rename, writeFile } from "node:fs/promises";
2
3
  import { dirname } from "node:path";
3
4
  import { randomUUID } from "node:crypto";
@@ -1 +1 @@
1
- {"version":3,"file":"adapters.js","sourceRoot":"","sources":["../src/adapters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMzC,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACzH,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC;IAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,GAAG,GAAG,KAAgC,CAAC;QAC7C,MAAM,GAAG,GAA4B,EAAE,CAAC;QACxC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7E,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAc;IACxC,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,KAAK,CAA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AW,EAAE;YACX,cAAc,EAAE,KAAK,CAAC,mBAAmB,IAAI,EAAE;YAC/C,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,cAAc,IAAI,IAAI,EAAE;YACpD,iBAAiB,EAAE,EAAE;YACrB,KAAK,EAAE,EAAE;SACV;KACF,CAAC;AACJ,CAAC"}
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PolicyEngine } from "@oxdeai/core";
2
- import type { Authorization, Intent } from "@oxdeai/core";
2
+ import type { AuthorizationV1, Intent } from "@oxdeai/core";
3
3
  import type { AuditAdapter, ClockAdapter, EvaluateAndCommitResult, StateAdapter, VerifyBundleResult } from "./types.js";
4
4
  type ClientOptions = {
5
5
  engine: PolicyEngine;
@@ -18,10 +18,37 @@ export declare class OxDeAIClient {
18
18
  private auditCursor;
19
19
  constructor(opts: ClientOptions);
20
20
  evaluateAndCommit(input: EvaluateInput): Promise<EvaluateAndCommitResult>;
21
- verifyAuthorization(intent: Intent, authorization: Authorization): Promise<{
21
+ /**
22
+ * Verifies an authorization against a trusted verification time.
23
+ *
24
+ * Verifier time is taken from the client's trusted clock boundary, or from an
25
+ * explicit `verificationTime` when the caller already holds one from the trusted
26
+ * execution boundary. It is never derived from `intent.timestamp`: that value is
27
+ * attacker-supplied and is hash-bound into the authorization at issuance, so using
28
+ * it as "now" pins the expiry comparison to issuance time and the authorization
29
+ * never expires.
30
+ *
31
+ * ⚠️ Inherits the LIMITED SCOPE of `PolicyEngine.verifyAuthorization` — it
32
+ * authenticates only the engine-HMAC field subset. Relying parties enforcing an
33
+ * authorization issued by an external party must use the strict standalone
34
+ * verifier with explicit `trustedKeySets` instead.
35
+ */
36
+ verifyAuthorization(intent: Intent, authorization: AuthorizationV1, opts?: {
37
+ verificationTime?: number;
38
+ }): Promise<{
22
39
  valid: boolean;
23
40
  reason?: string;
24
41
  }>;
42
+ /**
43
+ * Verifies the current in-memory snapshot, audit log, and envelope.
44
+ *
45
+ * Defaults to `mode: "best-effort"` — structural checks only, no `trustedKeySets`
46
+ * required. Passing `mode: "strict"` additionally requires a signed envelope with a
47
+ * STATE_CHECKPOINT; without `trustedKeySets` it will return `TRUSTED_KEYSETS_REQUIRED`.
48
+ *
49
+ * For PEP-side trust verification of artifacts issued by an external party, use
50
+ * `createVerifier` with explicit `trustedKeySets` rather than this method.
51
+ */
25
52
  verifyCurrentArtifacts(opts?: {
26
53
  mode?: "strict" | "best-effort";
27
54
  }): Promise<VerifyBundleResult>;
package/dist/client.js CHANGED
@@ -1,3 +1,4 @@
1
+ // SPDX-License-Identifier: Apache-2.0
1
2
  import { encodeCanonicalState, encodeEnvelope, verifyAuditEvents, verifyEnvelope, verifySnapshot } from "@oxdeai/core";
2
3
  function collectNewEvents(engine, cursor) {
3
4
  const all = engine.audit.snapshot();
@@ -18,14 +19,24 @@ export class OxDeAIClient {
18
19
  }
19
20
  async evaluateAndCommit(input) {
20
21
  const state = await this.stateAdapter.load();
22
+ // Single clock sample, reused for both the timestamp fallback below and
23
+ // evaluationTime — the trusted-time freshness gate requires evaluationTime
24
+ // to be sampled exactly once per evaluation (spec §2.1), and this.clock is
25
+ // the same trusted-context boundary already responsible for the timestamp
26
+ // fallback. Never derived from intent.timestamp itself (which may be
27
+ // attacker-supplied via `input.timestamp`). Note: this.clock defaults to
28
+ // Date.now()/1000 unless the caller supplies an independent ClockAdapter;
29
+ // an explicitly supplied value here is not necessarily independently
30
+ // trusted time.
31
+ const evaluationTime = this.clock.now();
21
32
  const resolvedTimestamp = input.timestamp === undefined || input.timestamp === 0
22
- ? this.clock.now()
33
+ ? evaluationTime
23
34
  : input.timestamp;
24
35
  const intent = {
25
36
  ...input,
26
37
  timestamp: resolvedTimestamp
27
38
  };
28
- const out = this.engine.evaluatePure(intent, state, { mode: "fail-fast" });
39
+ const out = this.engine.evaluatePure(intent, state, evaluationTime, { mode: "fail-fast" });
29
40
  const emitted = collectNewEvents(this.engine, this.auditCursor);
30
41
  this.auditCursor = emitted.nextCursor;
31
42
  if (this.auditAdapter)
@@ -45,11 +56,40 @@ export class OxDeAIClient {
45
56
  };
46
57
  return { output, state, auditEvents: emitted.events };
47
58
  }
48
- async verifyAuthorization(intent, authorization) {
59
+ /**
60
+ * Verifies an authorization against a trusted verification time.
61
+ *
62
+ * Verifier time is taken from the client's trusted clock boundary, or from an
63
+ * explicit `verificationTime` when the caller already holds one from the trusted
64
+ * execution boundary. It is never derived from `intent.timestamp`: that value is
65
+ * attacker-supplied and is hash-bound into the authorization at issuance, so using
66
+ * it as "now" pins the expiry comparison to issuance time and the authorization
67
+ * never expires.
68
+ *
69
+ * ⚠️ Inherits the LIMITED SCOPE of `PolicyEngine.verifyAuthorization` — it
70
+ * authenticates only the engine-HMAC field subset. Relying parties enforcing an
71
+ * authorization issued by an external party must use the strict standalone
72
+ * verifier with explicit `trustedKeySets` instead.
73
+ */
74
+ async verifyAuthorization(intent, authorization, opts) {
49
75
  const state = await this.stateAdapter.load();
50
- const result = this.engine.verifyAuthorization(intent, authorization, state, intent.timestamp);
76
+ const verificationTime = opts?.verificationTime ?? this.clock.now();
77
+ // Cast as Authorization: internal engine.verifyAuthorization() uses legacy fields
78
+ // (engine_signature, state_snapshot_hash) for HMAC binding verification.
79
+ // Authorization objects returned by evaluatePure() retain these at runtime.
80
+ const result = this.engine.verifyAuthorization(intent, authorization, state, verificationTime);
51
81
  return result.valid ? { valid: true } : { valid: false, reason: result.reason };
52
82
  }
83
+ /**
84
+ * Verifies the current in-memory snapshot, audit log, and envelope.
85
+ *
86
+ * Defaults to `mode: "best-effort"` — structural checks only, no `trustedKeySets`
87
+ * required. Passing `mode: "strict"` additionally requires a signed envelope with a
88
+ * STATE_CHECKPOINT; without `trustedKeySets` it will return `TRUSTED_KEYSETS_REQUIRED`.
89
+ *
90
+ * For PEP-side trust verification of artifacts issued by an external party, use
91
+ * `createVerifier` with explicit `trustedKeySets` rather than this method.
92
+ */
53
93
  async verifyCurrentArtifacts(opts) {
54
94
  const state = await this.stateAdapter.load();
55
95
  const snapshotBytes = encodeCanonicalState(this.engine.exportState(state));
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EACpB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,cAAc,EACf,MAAM,cAAc,CAAC;AAqBtB,SAAS,gBAAgB,CAAC,MAAoB,EAAE,MAAc;IAC5D,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAe,CAAC;IACjD,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACjC,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;AAC5C,CAAC;AAED,MAAM,OAAO,YAAY;IACN,MAAM,CAAe;IACrB,YAAY,CAAe;IAC3B,YAAY,CAAgB;IAC5B,KAAK,CAAe;IAC7B,WAAW,GAAG,CAAC,CAAC;IAExB,YAAY,IAAmB;QAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACtC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACtC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,KAAoB;QAC1C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;QAC7C,MAAM,iBAAiB,GAAG,KAAK,CAAC,SAAS,KAAK,SAAS,IAAI,KAAK,CAAC,SAAS,KAAK,CAAC;YAC9E,CAAC,CAAC,IAAI,CAAC,K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