agent-customs 1.2.6 → 1.2.7

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 CHANGED
@@ -62,8 +62,8 @@ Pick one of four ways. Each works with any site made with Cognizant's `agentify-
62
62
 
63
63
  ```html
64
64
  <script type="module"
65
- src="https://cdn.jsdelivr.net/gh/montbaga/agent-customs@v1.2.6/dist/agent-customs.js"
66
- integrity="sha384-WMl/1x9IOgwlSJuAl5nKo4CtY/x421qU9tkM8wWXyzImP1odffmefCeSm3lfLZgj"
65
+ src="https://cdn.jsdelivr.net/gh/montbaga/agent-customs@v1.2.7/dist/agent-customs.js"
66
+ integrity="sha384-fEd+J+uGUwm0jUq7z5tYf6h98EW7numklHCU8Lnv9mkL1m33S4JgcX83j3ELuszm"
67
67
  crossorigin="anonymous"></script>
68
68
  ```
69
69
 
@@ -76,7 +76,7 @@ Pick one of four ways. Each works with any site made with Cognizant's `agentify-
76
76
  ```js
77
77
  // At the top of site.js
78
78
  import { installCustomsGuard }
79
- from "https://cdn.jsdelivr.net/gh/montbaga/agent-customs@v1.2.6/site/customs/guard.js";
79
+ from "https://cdn.jsdelivr.net/gh/montbaga/agent-customs@v1.2.7/site/customs/guard.js";
80
80
 
81
81
  // Right after boot()
82
82
  installCustomsGuard(booted.engine, { strict: true });
@@ -173,16 +173,16 @@ Each way to add the guard, step by step. All of them work with any site built wi
173
173
  **1. One line (easiest).** Paste this into your page, above your other `<script>` tags. The guard switches itself on when your assistant starts.
174
174
 
175
175
  ```html
176
- <script type="module" src="https://cdn.jsdelivr.net/gh/montbaga/agent-customs@v1.2.6/dist/agent-customs.js" integrity="sha384-WMl/1x9IOgwlSJuAl5nKo4CtY/x421qU9tkM8wWXyzImP1odffmefCeSm3lfLZgj" crossorigin="anonymous"></script>
176
+ <script type="module" src="https://cdn.jsdelivr.net/gh/montbaga/agent-customs@v1.2.7/dist/agent-customs.js" integrity="sha384-fEd+J+uGUwm0jUq7z5tYf6h98EW7numklHCU8Lnv9mkL1m33S4JgcX83j3ELuszm" crossorigin="anonymous"></script>
177
177
  ```
178
178
 
179
- `integrity` is the file's fingerprint. If the file were ever changed, on the CDN or on the way, the browser would refuse to run it. The whole guard is in this one file ([`dist/agent-customs.js`](dist/agent-customs.js), built by `npm run bundle`), so the fingerprint covers all of it. `@v1.2.6` is a fixed version; to update, take the new line from the next release. Above the other tags, the browser runs it before your page starts the assistant, and chats wait until the guard is on. If your page has a `Content-Security-Policy` with `script-src`, add `https://cdn.jsdelivr.net` to it.
179
+ `integrity` is the file's fingerprint. If the file were ever changed, on the CDN or on the way, the browser would refuse to run it. The whole guard is in this one file ([`dist/agent-customs.js`](dist/agent-customs.js), built by `npm run bundle`), so the fingerprint covers all of it. `@v1.2.7` is a fixed version; to update, take the new line from the next release. Above the other tags, the browser runs it before your page starts the assistant, and chats wait until the guard is on. If your page has a `Content-Security-Policy` with `script-src`, add `https://cdn.jsdelivr.net` to it.
180
180
 
181
181
  **2. Two lines, with your own settings.** Load the guard from the same release and pass any of the *Guard options* below. A browser cannot check a fingerprint on an `import`, so for that use option 3 or 4.
182
182
 
183
183
  ```js
184
184
  // At the top of site.js
185
- import { installCustomsGuard } from "https://cdn.jsdelivr.net/gh/montbaga/agent-customs@v1.2.6/site/customs/guard.js";
185
+ import { installCustomsGuard } from "https://cdn.jsdelivr.net/gh/montbaga/agent-customs@v1.2.7/site/customs/guard.js";
186
186
 
187
187
  // Right after the boot(...) call
188
188
  installCustomsGuard(booted.engine, { strict: true });
@@ -601,6 +601,8 @@ This round fixed a weakness in how the rules handled their own exceptions, and i
601
601
  - Two more languages. Dutch and Indonesian requests for passwords and card numbers are now read word by word. Takeover, chat-leak and "download and run" orders are caught in 14 languages.
602
602
  - Honest numbers. False alarms on tools never seen before dropped from about 1 in 10 to about 1 in 18. New attack sets written after the changes were measured once before they were used. The details are in [How well it works](#how-well-it-works) and the [paper](PAPER.md#5--results).
603
603
 
604
+ **CORS advice fits the file (1.2.7).** For an A2A Agent Card or an MCP file, the CORS check now says to send `Access-Control-Allow-Origin: *` on that file. It used to name `agent-manifest.json`, the network file and `links.json`, which only Open Agentic Web sites have.
605
+
604
606
  **The terminal command gets its own window, and failed checks name their protocol (1.2.6).** When a site answers but the browser can't read it, the report now shows the command in a small terminal window with a *Copy* button, under the message instead of inside it. Paste it into PowerShell on Windows or Terminal on a Mac (it needs Node.js). In the report's JSON, the command is `verdict.command`. A failed check on an A2A Agent Card or an MCP file now shows *Google A2A* or *MCP Catalog* as its protocol, not *Open Agentic Web*, and an address where nothing was found shows no protocol.
605
607
 
606
608
  **"Could not inspect" now says why, and the command line runs everywhere (1.2.5).** When the page could not read an address, it listed three possible reasons. It now finds the real one and says what to do:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-customs",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "Border control for the Open Agentic Web: inspect any agent network before it runs in your browser.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Monty Bagati (https://github.com/montbaga)",
@@ -84,7 +84,9 @@ export async function analyzeNetwork(input) {
84
84
  detail: transport.cors === "ok" ? "Read from another origin, so callers' browsers can load it."
85
85
  : transport.cors === "same-origin" ? "Inspected from the same origin, so CORS was not exercised."
86
86
  : "Not checked from a browser.",
87
- fix: "Send Access-Control-Allow-Origin: * on agent-manifest.json, the network file and links.json." });
87
+ fix: protocol === "open-agentic-web"
88
+ ? "Send Access-Control-Allow-Origin: * on agent-manifest.json, the network file and links.json."
89
+ : "Send Access-Control-Allow-Origin: * on this file." });
88
90
  if (transport.redirects?.length) {
89
91
  check({ id: "P-REDIRECT", section: "3.2, 5", title: "No redirect to another origin",
90
92
  status: transport.redirects.some((r) => r.crossOrigin) ? "warn" : "pass",
@@ -166,7 +166,7 @@ function resolveKnownSample(raw) {
166
166
 
167
167
  function buildInstallSnippets() {
168
168
  return {
169
- oneLineScript: `<script type="module" src="https://cdn.jsdelivr.net/gh/montbaga/agent-customs@v${PKG_VERSION}/dist/agent-customs.js" integrity="sha384-WMl/1x9IOgwlSJuAl5nKo4CtY/x421qU9tkM8wWXyzImP1odffmefCeSm3lfLZgj" crossorigin="anonymous"></script>`,
169
+ oneLineScript: `<script type="module" src="https://cdn.jsdelivr.net/gh/montbaga/agent-customs@v${PKG_VERSION}/dist/agent-customs.js" integrity="sha384-fEd+J+uGUwm0jUq7z5tYf6h98EW7numklHCU8Lnv9mkL1m33S4JgcX83j3ELuszm" crossorigin="anonymous"></script>`,
170
170
  twoLines: `import { installCustomsGuard } from "https://cdn.jsdelivr.net/gh/montbaga/agent-customs@v${PKG_VERSION}/site/customs/guard.js";\ninstallCustomsGuard(booted.engine, { strict: true });`,
171
171
  npm: `npm install agent-customs\nimport { installCustomsGuard } from "agent-customs";\ninstallCustomsGuard(booted.engine);`,
172
172
  cli: `npx agent-customs check https://your-site.example/\nnpx agent-customs check ./my-network --strict\nnpx agent-customs mcp`,