@soverenia/agent-guard 1.0.2 → 1.0.4
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 +48 -27
- package/dist/mcp-server.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,31 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
Deterministic **SAFE / UPGRADE / AVOID** verdicts for every package your AI agent installs — signed (Ed25519) at the agent's decision point, via MCP. No LLM in the verdict path; the agent can only lower relevance, never rewrite a verdict to SAFE.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- API key: sign in at https://www.soverenia.com/login.html → dashboard → create key
|
|
5
|
+
## First verdict in 5 minutes
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
1. **Install** (provides `soverenia-mcp` + `soverenia-scan`):
|
|
9
8
|
|
|
10
|
-
```bash
|
|
11
|
-
npm install -g @soverenia/agent-guard
|
|
12
|
-
```
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @soverenia/agent-guard
|
|
11
|
+
```
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```json
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
2. **Get an API key**: sign in at https://www.soverenia.com/login.html → dashboard → create key. It is shown only once and starts with `sov_`. Provide it via the `SOVEREENIA_API_KEY` env var, or via a config file `~/.soverenia.json` (run `chmod 600` on it):
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{ "apiKey": "sov_…" }
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
3. **Add the MCP server to your agent.** Claude Code one-liner:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
claude mcp add soverenia --env SOVEREENIA_API_KEY=sov_… -- soverenia-mcp
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Any other MCP client — generic config:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"mcpServers": {
|
|
30
|
+
"soverenia": {
|
|
31
|
+
"command": "soverenia-mcp",
|
|
32
|
+
"env": { "SOVEREENIA_API_KEY": "sov_…" }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
4. **Ask your agent**: "check pkg:npm/lodash@4.17.21 before installing". It calls the `check_package` tool and reports the signed verdict (SAFE, UPGRADE → suggested version, or AVOID).
|
|
39
|
+
|
|
40
|
+
Other agents (Cursor, Codex, GitHub Copilot CLI, Mistral Vibe CLI), the manual HTTP variant and troubleshooting: https://docs.soverenia.com/agent-setup/
|
|
26
41
|
|
|
27
|
-
|
|
42
|
+
## CI gate
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
SOVEREENIA_API_KEY=sov_… soverenia-scan package-lock.json # exit 1 on AVOID
|
|
46
|
+
SOVEREENIA_API_KEY=sov_… soverenia-scan requirements.txt
|
|
47
|
+
```
|
|
28
48
|
|
|
29
|
-
##
|
|
49
|
+
## SDK
|
|
30
50
|
|
|
31
51
|
```typescript
|
|
32
52
|
import { AgentGuard, HttpMcpTransport, verifyResponse } from "@soverenia/agent-guard";
|
|
@@ -35,19 +55,20 @@ import { analyzeReachability } from "@soverenia/agent-guard/reachability";
|
|
|
35
55
|
const guard = new AgentGuard(new HttpMcpTransport("https://www.soverenia.com"), "https://www.soverenia.com");
|
|
36
56
|
const res = await guard.checkPackage({ purl: "pkg:pypi/jinja2", version: "3.0.0" });
|
|
37
57
|
|
|
38
|
-
const ok = await guard.verify(res); // Ed25519
|
|
58
|
+
const ok = await guard.verify(res); // Ed25519 against the public JWKS — locally, no server
|
|
39
59
|
|
|
40
60
|
const reach = analyzeReachability(".", "jinja2", "pypi");
|
|
41
61
|
guard.setLocalRelevance(reach.relevance); // "reachable" | "unreachable" | "unknown"
|
|
42
|
-
const final = guard.buildResponse(res); // authoritative
|
|
62
|
+
const final = guard.buildResponse(res); // authoritative is frozen+signed; the agent only writes local_context
|
|
43
63
|
```
|
|
44
64
|
|
|
45
|
-
|
|
65
|
+
Tools exposed over MCP: `check_package`, `check_install_plan` — proxied to the Soverenia engine with anti-replay headers (`X-Sovereignia-Timestamp`, `X-Sovereignia-Nonce`).
|
|
46
66
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
67
|
+
## Docs
|
|
68
|
+
|
|
69
|
+
- Quickstart for all agents: https://docs.soverenia.com/agent-setup/
|
|
70
|
+
- Docs: https://www.soverenia.com/docs/
|
|
71
|
+
- Homepage: https://www.soverenia.com
|
|
51
72
|
|
|
52
73
|
## License
|
|
53
74
|
|
package/dist/mcp-server.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { createInterface } from "node:readline";
|
|
6
6
|
import { HttpMcpTransport } from "./index.js";
|
|
7
7
|
const BASE = process.env.SOVEREENIA_BASE_URL ?? "https://www.soverenia.com";
|
|
8
|
-
const transport = new HttpMcpTransport(BASE, process.env.SOVEREENIA_API_KEY
|
|
8
|
+
const transport = new HttpMcpTransport(BASE, process.env.SOVEREENIA_API_KEY);
|
|
9
9
|
const SERVER_INFO = { name: "@soverenia/agent-guard", version: "1.0.0" };
|
|
10
10
|
async function handle(msg) {
|
|
11
11
|
switch (msg.method) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soverenia/agent-guard",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Agent Guard for Soverenia \u2014 deterministic SAFE/UPGRADE/AVOID verdicts for every package your AI agent installs (MCP stdio server + SDK + lockfile scanner)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|