@kurox_real/agentkit-canaryguard-402 0.0.0-stage → 1.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/README.md +24 -2
- package/dist/action.d.ts +38 -0
- package/dist/action.d.ts.map +1 -0
- package/dist/action.js +51 -0
- package/dist/action.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +50 -4
package/README.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @kurox_real/agentkit-canaryguard-402
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Coinbase AgentKit Action Provider for CanaryGuard 402 prompt-injection firewall and honeypot scrubber on Base (x402 protocol gated).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @kurox_real/agentkit-canaryguard-402 zod
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { executeCanaryGuardSanitize } from "@kurox_real/agentkit-canaryguard-402";
|
|
15
|
+
|
|
16
|
+
// Clean and sanitize untrusted text before ingesting into agent context
|
|
17
|
+
const result = await executeCanaryGuardSanitize({
|
|
18
|
+
content: "Scraped web text or untrusted user input here...",
|
|
19
|
+
strictMode: true,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
console.log("Status:", result.status); // "clean" | "neutralized" | "blocked"
|
|
23
|
+
console.log("Risk Score:", result.riskScore); // 0.00 - 1.00
|
|
24
|
+
console.log("Sanitized Content:", result.sanitizedContent);
|
|
25
|
+
```
|
package/dist/action.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CanaryGuardSanitizeInputSchema: z.ZodObject<{
|
|
3
|
+
content: z.ZodString;
|
|
4
|
+
strictMode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
content: string;
|
|
7
|
+
strictMode: boolean;
|
|
8
|
+
}, {
|
|
9
|
+
content: string;
|
|
10
|
+
strictMode?: boolean | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export type CanaryGuardSanitizeInput = z.infer<typeof CanaryGuardSanitizeInputSchema>;
|
|
13
|
+
export interface CanaryGuardSanitizeOutput {
|
|
14
|
+
status: "clean" | "neutralized" | "blocked";
|
|
15
|
+
riskScore: number;
|
|
16
|
+
injectionDetected: boolean;
|
|
17
|
+
threatsNeutralized: Array<{
|
|
18
|
+
type: string;
|
|
19
|
+
detail: string;
|
|
20
|
+
severity: number;
|
|
21
|
+
}>;
|
|
22
|
+
cryptoAddresses: Array<{
|
|
23
|
+
address: string;
|
|
24
|
+
chain: string;
|
|
25
|
+
risk_score: number;
|
|
26
|
+
reason: string;
|
|
27
|
+
}>;
|
|
28
|
+
sanitizedContent: string;
|
|
29
|
+
safetyReceipt: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Execute prompt-injection inspection and sanitization via CanaryGuard 402 microservice on Base.
|
|
33
|
+
*/
|
|
34
|
+
export declare function executeCanaryGuardSanitize(params: CanaryGuardSanitizeInput, options?: {
|
|
35
|
+
hostUrl?: string;
|
|
36
|
+
paymentHeader?: string;
|
|
37
|
+
}): Promise<CanaryGuardSanitizeOutput>;
|
|
38
|
+
//# sourceMappingURL=action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../src/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,8BAA8B;;;;;;;;;EAWzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAAC;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9E,eAAe,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/F,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,wBAAwB,EAChC,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GACrD,OAAO,CAAC,yBAAyB,CAAC,CAwCpC"}
|
package/dist/action.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const CanaryGuardSanitizeInputSchema = z.object({
|
|
3
|
+
content: z
|
|
4
|
+
.string()
|
|
5
|
+
.min(1)
|
|
6
|
+
.max(200_000)
|
|
7
|
+
.describe("Untrusted text, scraped HTML, email, or third-party tool output to sanitize before placing into agent context"),
|
|
8
|
+
strictMode: z
|
|
9
|
+
.boolean()
|
|
10
|
+
.optional()
|
|
11
|
+
.default(true)
|
|
12
|
+
.describe("When true, redacts high-risk crypto addresses and base64 blobs, and blocks wallet-draining commands"),
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Execute prompt-injection inspection and sanitization via CanaryGuard 402 microservice on Base.
|
|
16
|
+
*/
|
|
17
|
+
export async function executeCanaryGuardSanitize(params, options) {
|
|
18
|
+
const host = (options?.hostUrl ||
|
|
19
|
+
process.env.CANARYGUARD_URL ||
|
|
20
|
+
"https://canaryguard-402.onrender.com").replace(/\/$/, "");
|
|
21
|
+
const url = `${host}/v1/sanitize`;
|
|
22
|
+
const headers = {
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
};
|
|
25
|
+
if (options?.paymentHeader) {
|
|
26
|
+
headers["X-PAYMENT"] = options.paymentHeader;
|
|
27
|
+
}
|
|
28
|
+
const res = await fetch(url, {
|
|
29
|
+
method: "POST",
|
|
30
|
+
headers,
|
|
31
|
+
body: JSON.stringify({
|
|
32
|
+
content: params.content,
|
|
33
|
+
strict_mode: params.strictMode !== false,
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
if (!res.ok) {
|
|
37
|
+
const text = await res.text();
|
|
38
|
+
throw new Error(`CanaryGuard 402 error (${res.status}): ${text}`);
|
|
39
|
+
}
|
|
40
|
+
const data = (await res.json());
|
|
41
|
+
return {
|
|
42
|
+
status: data.status,
|
|
43
|
+
riskScore: data.risk_score,
|
|
44
|
+
injectionDetected: data.injection_detected,
|
|
45
|
+
threatsNeutralized: data.threats_neutralized || [],
|
|
46
|
+
cryptoAddresses: data.crypto_addresses || [],
|
|
47
|
+
sanitizedContent: data.sanitized_content,
|
|
48
|
+
safetyReceipt: data.safety_receipt,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../src/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,OAAO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AI,CAAC,UAAU;QAC1B,iBAAiB,EAAE,IAAI,CAAC,kBAAkB;QAC1C,kBAAkB,EAAE,IAAI,CAAC,mBAAmB,IAAI,EAAE;QAClD,eAAe,EAAE,IAAI,CAAC,gBAAgB,IAAI,EAAE;QAC5C,gBAAgB,EAAE,IAAI,CAAC,iBAAiB;QACxC,aAAa,EAAE,IAAI,CAAC,cAAc;KACnC,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kurox_real/agentkit-canaryguard-402",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Coinbase AgentKit Action Provider for CanaryGuard 402 prompt-injection firewall and honeypot scrubber on Base (x402 protocol gated).",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"prepublishOnly": "npm run build"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"agentkit",
|
|
26
|
+
"coinbase",
|
|
27
|
+
"coinbase-agentkit",
|
|
28
|
+
"canaryguard",
|
|
29
|
+
"x402",
|
|
30
|
+
"base",
|
|
31
|
+
"usdc",
|
|
32
|
+
"prompt-injection",
|
|
33
|
+
"firewall",
|
|
34
|
+
"security"
|
|
35
|
+
],
|
|
36
|
+
"author": "kurox_real",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "https://github.com/ak10082247-max/canaryguard-402.git",
|
|
44
|
+
"directory": "plugins/agentkit-canaryguard"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"zod": "^3.24.1"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"typescript": "^5.7.2"
|
|
51
|
+
}
|
|
52
|
+
}
|