@webdecoy/ai-protection 0.1.0-alpha.14 → 0.1.0-alpha.15
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/MCP.md +11 -0
- package/action-runtime.mjs +4 -1
- package/actions.d.mts +1 -1
- package/package.json +1 -1
package/MCP.md
CHANGED
|
@@ -361,3 +361,14 @@ pseudonym and existing pauses no longer match. Only opt-in Node action integrati
|
|
|
361
361
|
are covered, including this MCP adapter; Python/Go and unwrapped tools are not.
|
|
362
362
|
Listings and initialization remain available; this pauses new tool execution.
|
|
363
363
|
No automatic pause is applied after a decoy call.
|
|
364
|
+
|
|
365
|
+
#### Pause feedback (alpha.15)
|
|
366
|
+
|
|
367
|
+
The SDK includes the runtime's control revision in action check reports when
|
|
368
|
+
available. The dashboard can then distinguish a saved pause from an SDK-reported
|
|
369
|
+
denial for that exact revision, with server receipt time and request ID. Delayed
|
|
370
|
+
reports from an earlier pause do not confirm a later save. Older runtimes omit
|
|
371
|
+
the revision; enforcement still works but revision feedback remains unknown.
|
|
372
|
+
Report delivery is best effort and requires the normal reporting queue/flush.
|
|
373
|
+
This evidence is not acknowledgment from every replica, provider revocation, or
|
|
374
|
+
independent proof of execution. Outage behavior remains fail open.
|
package/action-runtime.mjs
CHANGED
|
@@ -40,7 +40,7 @@ export function prepareActionRuntime(options, definitions) {
|
|
|
40
40
|
const reporter=createReporter({reportingTimeoutMs:c.reportingTimeoutMs??1000,maxPendingReports:c.maxPendingReports??100,
|
|
41
41
|
onObservation:async(event,{signal})=>{
|
|
42
42
|
const checks=[{id:'action_boundary',source:'local',mode:'enforce',decision:event.decision,reason:event.reason,duration_ms:0},
|
|
43
|
-
...event.checks.map(check=>({id:check.id,source:check.source,mode:check.mode,decision:check.decision,reason:check.reason,duration_ms:check.durationMs}))];
|
|
43
|
+
...event.checks.map(check=>({id:check.id,source:check.source,mode:check.mode,decision:check.decision,reason:check.reason,duration_ms:check.durationMs,...(check.controlRevision?{control_revision:check.controlRevision}:{})}))];
|
|
44
44
|
const payload={schema:2,request_id:event.eventId,timestamp:event.timestamp,decision:event.decision,reason:event.reason,
|
|
45
45
|
degraded:event.checks.some(c=>c.decision==='unavailable'),checks,handler_attempted:event.attempted,
|
|
46
46
|
action:event.decision==='deny'?'denied':event.outcome==='unknown'?'handler_error':'forwarded',
|
|
@@ -62,7 +62,10 @@ export function prepareActionRuntime(options, definitions) {
|
|
|
62
62
|
if(!response.ok){await response.body?.cancel();throw Error('Caller control unavailable');}
|
|
63
63
|
const value=await readJSON(response,2048);
|
|
64
64
|
if(value.schema!==1||value.property_id!==c.propertyId.toLowerCase()||value.caller!==id||typeof value.allowed!=='boolean'||value.reason!==(value.allowed?'caller_allowed':'caller_paused'))throw Error('Invalid caller control response');
|
|
65
|
+
// Older runtimes omit revision evidence. Never invent it from receipt time.
|
|
66
|
+
if(value.control_revision != null && (!validPropertyID(value.control_revision)||value.control_revision==='00000000-0000-0000-0000-000000000000'))throw Error('Invalid caller control revision');
|
|
65
67
|
check.decision=value.allowed?'allow':'deny';check.reason=value.reason;
|
|
68
|
+
if(value.control_revision != null)check.controlRevision=value.control_revision.toLowerCase();
|
|
66
69
|
if(!value.allowed)denial={reason:'caller_paused',status:403};
|
|
67
70
|
} catch { signal.throwIfAborted(); }
|
|
68
71
|
check.durationMs=Math.max(0,performance.now()-started);return {check,denial};
|
package/actions.d.mts
CHANGED
|
@@ -48,7 +48,7 @@ export interface ActionEvent {
|
|
|
48
48
|
readonly schema: 1;
|
|
49
49
|
readonly eventId: string;
|
|
50
50
|
readonly timestamp: string;
|
|
51
|
-
readonly checks: readonly {id:string;source:string;mode:string;decision:string;reason:string;durationMs:number}[];
|
|
51
|
+
readonly checks: readonly {id:string;source:string;mode:string;decision:string;reason:string;durationMs:number;controlRevision?:string}[];
|
|
52
52
|
readonly actionId: string;
|
|
53
53
|
readonly action: string;
|
|
54
54
|
readonly policyVersion: string;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"test:types": "tsc --strict --noEmit --module nodenext --target es2022 test/types.mts test/mcp-types.mts",
|
|
12
12
|
"test:workers": "node --test test/workers/*.test.mjs"
|
|
13
13
|
},
|
|
14
|
-
"version": "0.1.0-alpha.
|
|
14
|
+
"version": "0.1.0-alpha.15",
|
|
15
15
|
"exports": {
|
|
16
16
|
"./fetch": {
|
|
17
17
|
"types": "./fetch.d.mts",
|