sealbridge 0.5.0 → 0.6.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.ja.md +4 -4
- package/README.md +5 -4
- package/dist/cli/dist/sdk.d.ts +4 -4
- package/dist/cli/dist/sdk.js +2 -2
- package/dist/cli/dist/sdk.js.map +1 -1
- package/dist/cli/dist/task-review.d.ts +1 -8
- package/dist/cli/dist/task-review.js +4 -17
- package/dist/cli/dist/task-review.js.map +1 -1
- package/dist/cli/dist/tasks.js +1 -1
- package/dist/cli/dist/tasks.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/packages/core/dist/content-inspection-rules.d.ts +22 -0
- package/dist/packages/core/dist/content-inspection-rules.js +34 -0
- package/dist/packages/core/dist/content-inspection-rules.js.map +1 -0
- package/dist/packages/core/dist/content-inspection.d.ts +43 -0
- package/dist/packages/core/dist/content-inspection.js +192 -0
- package/dist/packages/core/dist/content-inspection.js.map +1 -0
- package/dist/packages/core/dist/index.d.ts +2 -0
- package/dist/packages/core/dist/index.js +2 -0
- package/dist/packages/core/dist/index.js.map +1 -1
- package/dist/packages/runtime/dist/a2a.js +1 -1
- package/dist/packages/runtime/dist/application-config.js +69 -6
- package/dist/packages/runtime/dist/application-config.js.map +1 -1
- package/dist/packages/runtime/dist/held-request-store.d.ts +2 -0
- package/dist/packages/runtime/dist/held-request-store.js +3 -2
- package/dist/packages/runtime/dist/held-request-store.js.map +1 -1
- package/dist/packages/runtime/dist/held-task-content.d.ts +14 -0
- package/dist/packages/runtime/dist/held-task-content.js +33 -0
- package/dist/packages/runtime/dist/held-task-content.js.map +1 -0
- package/dist/packages/runtime/dist/index.d.ts +2 -0
- package/dist/packages/runtime/dist/index.js +2 -0
- package/dist/packages/runtime/dist/index.js.map +1 -1
- package/dist/packages/runtime/dist/mcp-server.js +1 -1
- package/dist/packages/runtime/dist/rule-content-review-child.d.ts +1 -0
- package/dist/packages/runtime/dist/rule-content-review-child.js +25 -0
- package/dist/packages/runtime/dist/rule-content-review-child.js.map +1 -0
- package/dist/packages/runtime/dist/rule-content-review.d.ts +9 -0
- package/dist/packages/runtime/dist/rule-content-review.js +217 -0
- package/dist/packages/runtime/dist/rule-content-review.js.map +1 -0
- package/dist/packages/runtime/dist/session.js +2 -1
- package/dist/packages/runtime/dist/session.js.map +1 -1
- package/docs/sdk.ja.md +104 -2
- package/docs/sdk.md +116 -2
- package/package.json +1 -1
package/docs/sdk.ja.md
CHANGED
|
@@ -36,10 +36,12 @@ import だけでは、鍵の作成・招待の読み取り・待受開始・rela
|
|
|
36
36
|
| 接続の metadata | `WorkerTrustStore`(`listConnections` を含む), `workerIntakePath` |
|
|
37
37
|
| 接続交換 | `ConnectionService`, `ConnectionRouter`, `StoredConnectionExchange`, `syncConnections` |
|
|
38
38
|
| 所有者の確認コマンド | `connectionsCommand`, `connectionHumanReview` |
|
|
39
|
-
| 保留の審査 | `ConnectionAdmissionReview`, `HeldRequestReview`, `unavailableHeldContentReviewProvider` |
|
|
39
|
+
| 保留の審査 | `ConnectionAdmissionReview`, `HeldRequestReview`, `unavailableHeldContentReviewProvider`, `createRuleBasedContentReviewProvider` |
|
|
40
|
+
| 検証済みタスク内容 | `taskContent` |
|
|
40
41
|
| 検索・招待 | `createSignedAgentCard`, `verifySignedAgentCard`, `createInviteToken`, `inviteTokenFromUri`, `isInviteTarget`, `parseAndVerifyInviteToken`, `discoverAgentCards`, `findDiscoveredAgentCard` |
|
|
41
42
|
| 鍵の生成 | `generateKeyPair` |
|
|
42
43
|
| MCP のホスト | `AcpMcpServer`, `mcpServerCommand`, `parseMcpServerArgs`, `mcpServerOptionsFromArgs` |
|
|
44
|
+
| 内容のルール検査 | `inspectRuleContent`, `CONTENT_INSPECTION_RULES`, `CONTENT_INSPECTION_RULESET_VERSION`, `CONTENT_INSPECTION_RULESET_DIGEST`, `CONTENT_INSPECTION_LIMITS` |
|
|
43
45
|
|
|
44
46
|
名前付きの型 exports:
|
|
45
47
|
|
|
@@ -57,7 +59,7 @@ import だけでは、鍵の作成・招待の読み取り・待受開始・rela
|
|
|
57
59
|
`ConnectionRouterOptions`, `ConnectedEvent`, `ConnectionsCommandOptions`。
|
|
58
60
|
- 審査: `HeldRequestReviewOptions`, `HeldContentReviewProvider`,
|
|
59
61
|
`HeldInspectionContext`, `InspectionCompletion`, `ConnectionAdmissionReviewOptions`,
|
|
60
|
-
`InboundConnectionSummary`。
|
|
62
|
+
`InboundConnectionSummary`, `HeldTaskContent`。
|
|
61
63
|
- MCP: `AcpMcpServerOptions`, `ApprovalProvider`, `ParsedMcpServerArgs`。
|
|
62
64
|
- core・転送: `KeyPair`, `Json`, `Signed`, `SignedEnvelope`, `Invite`,
|
|
63
65
|
`AgentSkill`, `DiscoveryAgentCard`, `CreateAgentCardOptions`, `SignedAgentCard`,
|
|
@@ -126,6 +128,31 @@ JSON の metadata・イベントを受け取ります。`now`・`transportFactor
|
|
|
126
128
|
任意の `peerDisplayName` を含み、表示名は情報として扱います。組み込み検査の対象は接続情報だけです。
|
|
127
129
|
[受信接続の審査](connections/admission.ja.md#受信接続の審査)を参照してください。
|
|
128
130
|
|
|
131
|
+
## 保留タスク内容の検証と取り出し
|
|
132
|
+
|
|
133
|
+
`taskContent(envelope, owner, contentDigest, envelopeDigest?)` は
|
|
134
|
+
`HeldTaskContent` として `{manifest, input, capabilityChains}` だけを返します。
|
|
135
|
+
能力の既定値は `[]` です。復号前に封筒の署名と宛先を検証し、暗号化と自身の `input`
|
|
136
|
+
欄を必須とします。manifest と提案の署名、PROPOSE・連番0・タスク・依頼者・
|
|
137
|
+
ワーカー所有者・内容ダイジェストの対応も検証します。保留レコードの `envelopeDigest`
|
|
138
|
+
を渡すと封筒全体との一致も検証します。招待・接続・転送用の欄は返しません。
|
|
139
|
+
既存 CLI の内部パスからの import を含め、3引数の呼び出しも維持します。
|
|
140
|
+
|
|
141
|
+
結果は機微な平文をメモリ内に含みます。ログや永続保存に入れず、文字列データとして
|
|
142
|
+
表示してください。所有者向けに表示する呼び出し側は、`HeldRequestReview` による
|
|
143
|
+
検査完了(所有者・内容・封筒に結び付いた受領書を含む)を別途必須にしてください。
|
|
144
|
+
取り出し自体は検査状態を確認せず、開封・接続同意・実行を承認しません。
|
|
145
|
+
検査 provider は検査中にこの関数を使えます。能力チェーンの権限・信頼・現在の grant や
|
|
146
|
+
依頼期限の有効性は検証しません。期限を過ぎた終端タスクも内容を検証でき、
|
|
147
|
+
ライブ受付は従来の別の検証を維持します。構造と署名などの検証であり、
|
|
148
|
+
内容に対するヒューリスティックな検出・評価は行いません。
|
|
149
|
+
|
|
150
|
+
検証失敗は `INVALID_PROPOSAL`、暗号化入力の失敗は従来の
|
|
151
|
+
`UNENCRYPTED_ENVELOPE_REJECTED` または `ENVELOPE_DECRYPTION_FAILED` です。
|
|
152
|
+
スキーマやネイティブパーサーの詳細は返しません。検査受領書の作成・ファイル書き込み・
|
|
153
|
+
通信は行わず、プロトコル・スキーマ・必須欄・保存形式は変更しません。
|
|
154
|
+
[保留内容の審査](connections/held-content.ja.md)を参照してください。
|
|
155
|
+
|
|
129
156
|
## MCP のライフサイクル
|
|
130
157
|
|
|
131
158
|
専用の stdio MCP プロセスでは `mcpServerCommand(args, identityOptions)` が既存 CLI
|
|
@@ -140,3 +167,78 @@ JSON の metadata・イベントを受け取ります。`now`・`transportFactor
|
|
|
140
167
|
## 監査の中断証拠
|
|
141
168
|
|
|
142
169
|
`parseJsonl` / `verifyAudit` は双方署名の形式専用を維持します。`parseAuditJsonl` / `verifyAuditEvidence` は `AuditEvidence`(`AuditBundle | InterruptedAuditBundle`)を扱い、ワーカー単独の形式 1 の終端は、外部ピンが一致しても `UNILATERALLY_CLOSED`・`valid:false` です。`createAuditInterruption`・対応ストア・関連公開型も `sealbridge/sdk` から利用できます。[保存形式・ピン・永続化・依頼者との照合規則(英語)](audit-interruption.md)を参照してください。
|
|
170
|
+
|
|
171
|
+
## 明示的に選ぶオフラインの内容検査
|
|
172
|
+
|
|
173
|
+
`inspectRuleContent({manifest,input,capabilityChains?}, limits?, signal?)` は
|
|
174
|
+
core のメモリ上の検査器です。公開する型は `RuleInspectionInput`、
|
|
175
|
+
`RuleInspectionOptions`、`RuleInspectionRule`、`RuleInspectionKind`、
|
|
176
|
+
`RuleInspectionFinding`、`RuleInspectionDiagnosticCode`、`RuleInspectionReport`、
|
|
177
|
+
`RuleBasedContentReviewOptions` です。ルールと走査は core、子プロセス管理は runtime
|
|
178
|
+
が担当します。edge の入口は変えません。
|
|
179
|
+
|
|
180
|
+
保留中のタスクには、プロバイダを明示的に渡します。
|
|
181
|
+
|
|
182
|
+
```ts
|
|
183
|
+
import { HeldRequestReview, WorkerNode, createRuleBasedContentReviewProvider } from 'sealbridge/sdk';
|
|
184
|
+
|
|
185
|
+
const inspectionTimeoutMs = 5000;
|
|
186
|
+
const heldReview = new HeldRequestReview(owner, {
|
|
187
|
+
...identityOptions,
|
|
188
|
+
inspectionTimeoutMs,
|
|
189
|
+
provider: createRuleBasedContentReviewProvider({
|
|
190
|
+
timeoutMs: inspectionTimeoutMs,
|
|
191
|
+
onReport(recordId, report) {
|
|
192
|
+
// 所有者向けの資料として、メモリ上で文字どおり表示する。
|
|
193
|
+
renderInspection(recordId, report);
|
|
194
|
+
},
|
|
195
|
+
}),
|
|
196
|
+
});
|
|
197
|
+
const worker = new WorkerNode({ ...workerOptions, owner, heldReview });
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
`owner`・`identityOptions`・`workerOptions`・`renderInspection` は組み込み側が用意します。
|
|
201
|
+
プロバイダの制限時間は review 以下にします。両方の既定は5秒、指定範囲は1〜45,000 ms
|
|
202
|
+
です。中止、どちらかの時間切れ、失敗で子を終了します。コールバックの例外・拒否・中断・
|
|
203
|
+
時間超過でも完了になりません。コールバックへ渡すレポートは複製なので、変更しても受領の
|
|
204
|
+
内容は変わりません。これはホストの処理であり、任意のコードを隔離する口ではありません。
|
|
205
|
+
|
|
206
|
+
外側の封筒署名、暗号化された宛先、署名付き proposal、manifest、タスク・送信者・
|
|
207
|
+
ワーカーと保留ダイジェストの一致を確認してから、manifest・input・capabilities だけを
|
|
208
|
+
固定のビルド済み検査器へ IPC で渡します。所有者の鍵と通信用の資格情報は渡しません。
|
|
209
|
+
環境変数は許可リストから作り、結果は64 KiBまでとし、中止・時間切れ・失敗で子を終了します。
|
|
210
|
+
平文ファイルやログを書かず、ネットワーク要求・DNS照会・実行・アーカイブの展開をしません。
|
|
211
|
+
カーネルのネットワーク隔離ではなく、固定の信頼したコードです。外部プラグイン、ダウンロード
|
|
212
|
+
したルール、呼び出し側の正規表現・ソースコードは受け付けません。
|
|
213
|
+
|
|
214
|
+
変更不可の記述子・検出器の版・既定の上限から `CONTENT_INSPECTION_RULESET_DIGEST` を
|
|
215
|
+
作ります。既定は直列化した内容256 KiB、深さ32、ノードとキー合計100,000、文字列ごと
|
|
216
|
+
UTF-8で64 KiB、所見100件、base64復号合計64 KiBです。`limits` では下げることだけができます。
|
|
217
|
+
作業量・出力の上限超過は `error` とし、切り詰めて成功にはしません。manifest の全欄・
|
|
218
|
+
input・capabilities・文字列のキーを JSON Pointer 順で検査します。位置は元の文字列の
|
|
219
|
+
UTF-16単位です。パスは `~0`・`~1` でエスケープし、機微な内容の可能性があるキーは
|
|
220
|
+
`[redacted]` に置き換えます。所見の説明と診断は固定コードで、証拠の抜粋やURLの値は
|
|
221
|
+
含めません。通常のキーは位置に含まれるため、レポートも確認用の資料として扱います。
|
|
222
|
+
|
|
223
|
+
見えない文字・制御文字、英語と日本語の指示表現、URLの形、秘密を求める語と動詞の
|
|
224
|
+
組み合わせ、資格情報の典型的な形、コードの目印、長いbase64を検出します。復号は上限を
|
|
225
|
+
設けて1回だけ行い、実行形式・アーカイブの先頭バイトなら `block` にします。検出は
|
|
226
|
+
ヒューリスティックです。通常の引用文にも反応し、未対応の表現は通ることがあります。
|
|
227
|
+
資格情報をオンラインで確認しません。`pass` はこのルールで所見が出なかったことを示します。
|
|
228
|
+
`pass`・`warn`・`block` の完了はいずれも既存受領の `complete` になり、`block` は
|
|
229
|
+
所有者への最も強い注意です。実行許可や開封にはならず、その会期の人間による契約承認は
|
|
230
|
+
引き続き必要です。失敗は途中の所見より優先し `error` になり、検査完了前の表示を許可しません。
|
|
231
|
+
|
|
232
|
+
`contentDigest` は `digest({manifest,input})` です。capabilities と実効上限はレポートと
|
|
233
|
+
正確な封筒を通じて結び付けます。core 単体で上限内の JSON 複製を作る前に失敗した場合は、
|
|
234
|
+
不完全な値として `digest(null)` を返します。エラーレポートを内容の検証に使わないでください。
|
|
235
|
+
runtime は認証できた保留のダイジェストにエラーレポートを結び付けます。既存受領の
|
|
236
|
+
`reportDigest` は `{recordId,ownerDid,kind,contentDigest,envelopeDigest,report}` の
|
|
237
|
+
ハッシュです。保存するのはこのダイジェストだけで、レポート全体は `onReport` のメモリ内に
|
|
238
|
+
とどめます。既存受領に所見はなく、`HeldRequestReview.inspect` はキャッシュ済み完了を返す
|
|
239
|
+
場合があります。再起動後にレポートが必要なら、保存済み封筒と対応する inspection context
|
|
240
|
+
でプロバイダを明示的に再実行します。受領から所見なしと推定せず、ディスクにレポートの
|
|
241
|
+
キャッシュを作らないでください。
|
|
242
|
+
|
|
243
|
+
task 以外は `unavailable` です。既定の検査、CLI の表示、trusted の受付、MCP、自動承認の
|
|
244
|
+
動作は変わりません。protocol・schema・manifest 必須欄・通信形式・保存形式を変えません。
|
package/docs/sdk.md
CHANGED
|
@@ -39,10 +39,12 @@ All values are direct re-exports of existing implementations, without wrappers.
|
|
|
39
39
|
| Connection metadata | `WorkerTrustStore` (including `listConnections`), `workerIntakePath` |
|
|
40
40
|
| Connection exchange | `ConnectionService`, `ConnectionRouter`, `StoredConnectionExchange`, `syncConnections` |
|
|
41
41
|
| Owner confirmation command | `connectionsCommand`, `connectionHumanReview` |
|
|
42
|
-
| Held review | `ConnectionAdmissionReview`, `HeldRequestReview`, `unavailableHeldContentReviewProvider` |
|
|
42
|
+
| Held review | `ConnectionAdmissionReview`, `HeldRequestReview`, `unavailableHeldContentReviewProvider`, `createRuleBasedContentReviewProvider` |
|
|
43
|
+
| Verified task content | `taskContent` |
|
|
43
44
|
| Discovery and invitations | `createSignedAgentCard`, `verifySignedAgentCard`, `createInviteToken`, `inviteTokenFromUri`, `isInviteTarget`, `parseAndVerifyInviteToken`, `discoverAgentCards`, `findDiscoveredAgentCard` |
|
|
44
45
|
| Key creation | `generateKeyPair` |
|
|
45
46
|
| MCP hosting | `AcpMcpServer`, `mcpServerCommand`, `parseMcpServerArgs`, `mcpServerOptionsFromArgs` |
|
|
47
|
+
| Content rules | `inspectRuleContent`, `CONTENT_INSPECTION_RULES`, `CONTENT_INSPECTION_RULESET_VERSION`, `CONTENT_INSPECTION_RULESET_DIGEST`, `CONTENT_INSPECTION_LIMITS` |
|
|
46
48
|
|
|
47
49
|
Named type exports:
|
|
48
50
|
|
|
@@ -60,7 +62,7 @@ Named type exports:
|
|
|
60
62
|
`ConnectionRouterOptions`, `ConnectedEvent`, `ConnectionsCommandOptions`.
|
|
61
63
|
- Review: `HeldRequestReviewOptions`, `HeldContentReviewProvider`,
|
|
62
64
|
`HeldInspectionContext`, `InspectionCompletion`, `ConnectionAdmissionReviewOptions`,
|
|
63
|
-
`InboundConnectionSummary`.
|
|
65
|
+
`InboundConnectionSummary`, `HeldTaskContent`.
|
|
64
66
|
- MCP: `AcpMcpServerOptions`, `ApprovalProvider`, `ParsedMcpServerArgs`.
|
|
65
67
|
- Core/transport: `KeyPair`, `Json`, `Signed`, `SignedEnvelope`, `Invite`,
|
|
66
68
|
`AgentSkill`, `DiscoveryAgentCard`, `CreateAgentCardOptions`, `SignedAgentCard`,
|
|
@@ -134,6 +136,34 @@ inbound connections. Bind decisions to explicit owner actions. Its
|
|
|
134
136
|
names are informational data. Built-in inspection covers connection metadata only.
|
|
135
137
|
See [owner admission review](connections/admission.md#owner-admission-review).
|
|
136
138
|
|
|
139
|
+
## Verified held task content
|
|
140
|
+
|
|
141
|
+
`taskContent(envelope, owner, contentDigest, envelopeDigest?)` returns a
|
|
142
|
+
`HeldTaskContent` containing only `{manifest, input, capabilityChains}`;
|
|
143
|
+
capabilities default to `[]`. It verifies the outer signature and recipient before
|
|
144
|
+
decrypting, requires encrypted content and an own `input` field, validates the
|
|
145
|
+
manifest and signed proposal, and checks PROPOSE/sequence-zero, task, requester,
|
|
146
|
+
worker-owner and content-digest bindings. Supply the held record's `envelopeDigest`
|
|
147
|
+
to also bind the exact envelope. Invitation, connection and transport fields are
|
|
148
|
+
excluded. The three-argument form remains supported, including the existing CLI
|
|
149
|
+
deep import of `taskContent`.
|
|
150
|
+
|
|
151
|
+
The result is sensitive plaintext in memory. Keep it out of logs and persistent
|
|
152
|
+
storage; render it as literal data. Owner-facing display callers must separately
|
|
153
|
+
require completed review through `HeldRequestReview` (including its owner/content/
|
|
154
|
+
envelope-bound receipt); extraction itself does not check inspection or authorize
|
|
155
|
+
opening, connection consent or execution. Inspection providers may use the helper
|
|
156
|
+
while inspecting content. It does not validate capability-chain authority, trust,
|
|
157
|
+
or current grant/deadline usability. Expired terminal task content can still be
|
|
158
|
+
verified; live admission retains its separate checks. This is structural and
|
|
159
|
+
cryptographic verification, not a content heuristic or assessment.
|
|
160
|
+
|
|
161
|
+
Verification failures use `INVALID_PROPOSAL`; encrypted-input failures retain
|
|
162
|
+
`UNENCRYPTED_ENVELOPE_REJECTED` or `ENVELOPE_DECRYPTION_FAILED`. Schema and native
|
|
163
|
+
parser details are excluded. The helper creates no inspection receipt, writes no
|
|
164
|
+
files and makes no network requests. Protocol, schemas, required fields and stored
|
|
165
|
+
record formats are unchanged. See [held-content review](connections/held-content.md).
|
|
166
|
+
|
|
137
167
|
## MCP lifecycle
|
|
138
168
|
|
|
139
169
|
In a dedicated stdio MCP process, `mcpServerCommand(args, identityOptions)` runs the
|
|
@@ -147,3 +177,87 @@ is a separate `connectionReview` option. See [MCP integration](../README.md#mcp-
|
|
|
147
177
|
## Audit evidence
|
|
148
178
|
|
|
149
179
|
`parseJsonl` / `verifyAudit` retain their bilateral-only contracts. Use `parseAuditJsonl` / `verifyAuditEvidence` for the `AuditEvidence` union (`AuditBundle | InterruptedAuditBundle`). Worker-only format-1 terminals return `UNILATERALLY_CLOSED` with `valid:false`, even with matching external pins; ordinary result APIs still require bilateral bundles. `createAuditInterruption`, the interruption-aware stores, and public evidence types are exported from `sealbridge/sdk`. See [storage, pins, durability, and requester comparison rules](audit-interruption.md).
|
|
180
|
+
|
|
181
|
+
## Opt-in offline content rules
|
|
182
|
+
|
|
183
|
+
`inspectRuleContent({manifest,input,capabilityChains?}, limits?, signal?)` is the
|
|
184
|
+
in-memory core scanner. `RuleInspectionInput`, `RuleInspectionOptions`,
|
|
185
|
+
`RuleInspectionRule`, `RuleInspectionKind`, `RuleInspectionFinding`,
|
|
186
|
+
`RuleInspectionDiagnosticCode`, `RuleInspectionReport`, and
|
|
187
|
+
`RuleBasedContentReviewOptions` are supported SDK type exports. Core owns the
|
|
188
|
+
rules and traversal; runtime owns the child process. The edge entry is unchanged.
|
|
189
|
+
|
|
190
|
+
For held tasks, inject the provider explicitly:
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
import { HeldRequestReview, WorkerNode, createRuleBasedContentReviewProvider } from 'sealbridge/sdk';
|
|
194
|
+
|
|
195
|
+
const inspectionTimeoutMs = 5000;
|
|
196
|
+
const heldReview = new HeldRequestReview(owner, {
|
|
197
|
+
...identityOptions,
|
|
198
|
+
inspectionTimeoutMs,
|
|
199
|
+
provider: createRuleBasedContentReviewProvider({
|
|
200
|
+
timeoutMs: inspectionTimeoutMs,
|
|
201
|
+
onReport(recordId, report) {
|
|
202
|
+
// Supply literal owner-facing review material in memory.
|
|
203
|
+
renderInspection(recordId, report);
|
|
204
|
+
},
|
|
205
|
+
}),
|
|
206
|
+
});
|
|
207
|
+
const worker = new WorkerNode({ ...workerOptions, owner, heldReview });
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Here `owner`, `identityOptions`, `workerOptions`, and `renderInspection` belong to
|
|
211
|
+
the embedding host. Keep provider timeout at or below the review timeout; both
|
|
212
|
+
default to 5 seconds and accept 1–45,000 ms. Cancellation or either deadline ends
|
|
213
|
+
inspection and terminates the child. Callback failure, rejection, interruption or
|
|
214
|
+
exceeding that deadline cannot produce completion. The callback receives a copy;
|
|
215
|
+
its mutation cannot change the receipt. It is a host callback, not an isolation
|
|
216
|
+
boundary for arbitrary code.
|
|
217
|
+
|
|
218
|
+
The provider verifies the outer envelope, encrypted recipient, signed proposal,
|
|
219
|
+
manifest, task/sender/worker and held digests before projecting manifest, input and
|
|
220
|
+
capabilities into the fixed compiled scanner over IPC. Owner keys and transport
|
|
221
|
+
credentials are excluded. It uses an environment allowlist, a 64 KiB result cap,
|
|
222
|
+
and termination on abort, timeout or failure. It writes no plaintext files or
|
|
223
|
+
logs and makes no network requests, DNS lookups, execution or archive extraction.
|
|
224
|
+
This fixed trusted scanner does not provide kernel network isolation or accept
|
|
225
|
+
plugins, downloaded rules, caller regexes or source code.
|
|
226
|
+
|
|
227
|
+
The immutable descriptors, detector version and default limits determine
|
|
228
|
+
`CONTENT_INSPECTION_RULESET_DIGEST`. Defaults are 256 KiB serialized content,
|
|
229
|
+
depth 32, 100,000 nodes/keys, 64 KiB of UTF-8 per string, 100 findings and 64 KiB total
|
|
230
|
+
decoded base64 bytes. `limits` may lower these local bounds. Exceeding a work or
|
|
231
|
+
result bound is `error`; findings are never silently truncated into success.
|
|
232
|
+
All manifest fields, input, capabilities and string keys are scanned in JSON
|
|
233
|
+
Pointer order. Location offsets count original UTF-16 units; pointer segments use
|
|
234
|
+
`~0`/`~1` escaping, with potentially sensitive keys replaced by `[redacted]`.
|
|
235
|
+
Reports contain fixed note/diagnostic codes and no evidence snippets or URL values.
|
|
236
|
+
Ordinary keys can occur as location segments; treat reports as review material.
|
|
237
|
+
|
|
238
|
+
The rules check invisible/control characters, English/Japanese instruction phrases,
|
|
239
|
+
URL forms, combined secret requests, recognizable credential forms, code markers
|
|
240
|
+
and long base64. Decoding is bounded and performed once; executable/archive
|
|
241
|
+
prefixes produce `block`. These are heuristics: matching text may be ordinary
|
|
242
|
+
quoted material, unrecognized forms may pass, and credentials are not verified
|
|
243
|
+
online. A `pass` is the absence of findings from these rules. A completed
|
|
244
|
+
`pass`, `warn` or `block` maps to the existing receipt's `complete`, with `block`
|
|
245
|
+
as the strongest owner warning. None authorizes execution, opens a task or
|
|
246
|
+
bypasses the existing live human contract decision. Failures outrank partial
|
|
247
|
+
findings, remain `error`, and preserve the completed-inspection display gate.
|
|
248
|
+
|
|
249
|
+
`contentDigest` is `digest({manifest,input})`; supplied capabilities and effective
|
|
250
|
+
limits are bound through the report and exact envelope. A standalone core error
|
|
251
|
+
before a bounded JSON snapshot exists uses `digest(null)` as an incomplete digest;
|
|
252
|
+
never use an error report as content verification. The runtime binds error reports
|
|
253
|
+
to the authenticated held digest. The receipt's existing `reportDigest` hashes
|
|
254
|
+
`{recordId,ownerDid,kind,contentDigest,envelopeDigest,report}`. Only this digest is
|
|
255
|
+
persisted; full reports remain in `onReport` memory. Existing cached receipts
|
|
256
|
+
contain no findings: `HeldRequestReview.inspect` can return a cached completion
|
|
257
|
+
without calling the provider. After restart, explicitly call the provider with the
|
|
258
|
+
stored envelope and bound inspection context when a report is needed. Do not
|
|
259
|
+
infer an empty report from a receipt or create a report cache on disk.
|
|
260
|
+
|
|
261
|
+
Other held kinds return `unavailable`. Default review, CLI display, trusted
|
|
262
|
+
admission, MCP and automatic approval behavior are unchanged. No protocol,
|
|
263
|
+
schema, required manifest field, wire or stored-record format changes are made.
|