@shield-agent/kya 0.32.6 → 0.32.9

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.
Files changed (86) hide show
  1. package/.cursor-plugin/plugin.json +2 -2
  2. package/.mcp.json +1 -1
  3. package/README.md +67 -13
  4. package/amp/settings.example.json +1 -1
  5. package/claude/claude_desktop_config.example.json +1 -1
  6. package/cline/cline_mcp_settings.example.json +1 -1
  7. package/copilot/mcp-config.example.json +1 -1
  8. package/dist/cli.d.ts.map +1 -1
  9. package/dist/cli.js +101 -38
  10. package/dist/cli.js.map +1 -1
  11. package/dist/client.d.ts +2 -0
  12. package/dist/client.d.ts.map +1 -1
  13. package/dist/client.js +1 -1
  14. package/dist/client.js.map +1 -1
  15. package/dist/commands/eval-tool.js +1 -1
  16. package/dist/commands/eval-tool.js.map +1 -1
  17. package/dist/commands/hook.d.ts.map +1 -1
  18. package/dist/commands/hook.js +21 -6
  19. package/dist/commands/hook.js.map +1 -1
  20. package/dist/commands/login.d.ts +34 -0
  21. package/dist/commands/login.d.ts.map +1 -0
  22. package/dist/commands/login.js +74 -0
  23. package/dist/commands/login.js.map +1 -0
  24. package/dist/config.d.ts +2 -0
  25. package/dist/config.d.ts.map +1 -1
  26. package/dist/config.js.map +1 -1
  27. package/dist/cta.d.ts +23 -0
  28. package/dist/cta.d.ts.map +1 -0
  29. package/dist/cta.js +86 -0
  30. package/dist/cta.js.map +1 -0
  31. package/dist/fs-atomic.d.ts +6 -0
  32. package/dist/fs-atomic.d.ts.map +1 -1
  33. package/dist/fs-atomic.js +14 -3
  34. package/dist/fs-atomic.js.map +1 -1
  35. package/dist/login/credentials.d.ts +17 -0
  36. package/dist/login/credentials.d.ts.map +1 -0
  37. package/dist/login/credentials.js +64 -0
  38. package/dist/login/credentials.js.map +1 -0
  39. package/dist/login/device-flow.d.ts +44 -0
  40. package/dist/login/device-flow.d.ts.map +1 -0
  41. package/dist/login/device-flow.js +205 -0
  42. package/dist/login/device-flow.js.map +1 -0
  43. package/dist/mcp/protocol.js +1 -1
  44. package/dist/mcp/protocol.js.map +1 -1
  45. package/dist/never-list-input.d.ts +56 -0
  46. package/dist/never-list-input.d.ts.map +1 -0
  47. package/dist/never-list-input.js +1222 -0
  48. package/dist/never-list-input.js.map +1 -0
  49. package/dist/offline-evaluate.d.ts +17 -5
  50. package/dist/offline-evaluate.d.ts.map +1 -1
  51. package/dist/offline-evaluate.js +67 -9
  52. package/dist/offline-evaluate.js.map +1 -1
  53. package/dist/otel.d.ts +8 -2
  54. package/dist/otel.d.ts.map +1 -1
  55. package/dist/otel.js +32 -16
  56. package/dist/otel.js.map +1 -1
  57. package/dist/receipt/embeddings.d.ts +5 -1
  58. package/dist/receipt/embeddings.d.ts.map +1 -1
  59. package/dist/receipt/embeddings.js +71 -8
  60. package/dist/receipt/embeddings.js.map +1 -1
  61. package/dist/receipt/render-receipt.d.ts.map +1 -1
  62. package/dist/receipt/render-receipt.js +8 -2
  63. package/dist/receipt/render-receipt.js.map +1 -1
  64. package/dist/star-cta.d.ts +2 -2
  65. package/dist/star-cta.d.ts.map +1 -1
  66. package/dist/star-cta.js +1 -1
  67. package/dist/star-cta.js.map +1 -1
  68. package/dist/trail.d.ts +4 -0
  69. package/dist/trail.d.ts.map +1 -1
  70. package/dist/trail.js +14 -0
  71. package/dist/trail.js.map +1 -1
  72. package/droid/README.md +1 -1
  73. package/droid/mcp.example.json +1 -1
  74. package/gemini/settings.example.json +1 -1
  75. package/grok/README.md +1 -1
  76. package/kilo/kilo.example.json +1 -1
  77. package/kimi/mcp.example.json +1 -1
  78. package/kiro/mcp.example.json +1 -1
  79. package/manifest.json +1 -1
  80. package/mastracode/mcp.example.json +1 -1
  81. package/mcp.json +1 -1
  82. package/openai/codex.config.example.toml +1 -1
  83. package/opencode/opencode.example.json +1 -1
  84. package/package.json +2 -5
  85. package/qwen/settings.example.json +1 -1
  86. package/server.json +2 -2
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shield-kya",
3
- "version": "0.32.6",
4
- "description": "Audit trail and traceability for AI agents. See what every coding agent did, block risky calls, ask a human for approval, and prove it with signed trust checks.",
3
+ "version": "0.32.9",
4
+ "description": "Audit trail and traceability for AI agents. See what every coding agent did and check each tool call against policy.",
5
5
  "author": {
6
6
  "name": "Shield Agent",
7
7
  "email": "it@shield-agent.com"
package/.mcp.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "mcpServers": {
3
3
  "shield-kya": {
4
4
  "command": "npx",
5
- "args": ["--no-install", "@shield-agent/kya@0.32.6", "serve-mcp", "--stdio"],
5
+ "args": ["--no-install", "@shield-agent/kya@0.32.9", "serve-mcp", "--stdio"],
6
6
  "env": {
7
7
  "KYA_BASE_URL": "https://shield-agent.com",
8
8
  "KYA_API_KEY": "${KYA_API_KEY}",
package/README.md CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/@shield-agent/kya.svg?logo=npm&label=npm)](https://www.npmjs.com/package/@shield-agent/kya)
4
4
  [![npm downloads/week](https://img.shields.io/npm/dw/@shield-agent/kya.svg?logo=npm&label=downloads%2Fweek)](https://www.npmjs.com/package/@shield-agent/kya)
5
- [![npm downloads](https://img.shields.io/npm/dt/@shield-agent/kya.svg?logo=npm&label=total%20downloads)](https://www.npmjs.com/package/@shield-agent/kya)
5
+ [![npm downloads, 18 months](https://img.shields.io/npm/d18m/@shield-agent/kya.svg?logo=npm&label=downloads%2C%2018%20months)](https://www.npmjs.com/package/@shield-agent/kya)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)
7
7
  [![Install](https://img.shields.io/badge/install-shield--agent.com%2Finstall-0A0A0A)](https://shield-agent.com/install)
8
8
  [![X](https://img.shields.io/badge/X-%40coscosmico-000000?logo=x&logoColor=white)](https://x.com/coscosmico)
9
9
 
10
10
 
11
- **Audit trail and traceability for AI agents.** See what every coding agent did, block risky calls, ask a human for approval, and prove it with signed trust checks. Every tool call is recorded on a live local dashboard and can be checked against the Agent Trust Baseline. Locally KYA gives warnings, not blocks, and fails open (an error lets the call through). The one exception is a small never-list (a short list of dangerous calls that is always denied). Real enforcement runs on the MCP gate path and the hosted plane (the Shield Agent cloud service). One command. Free forever under MIT.
11
+ **Audit trail and traceability for AI agents.** See what every coding agent did and check each tool call against policy. Every tool call is recorded on a live local dashboard and can be checked against the Agent Trust Baseline. The open source client is advisory and fails open (an error lets the call through), apart from a small never-list of dangerous calls that is always denied. Real blocking and human approval run on the MCP policy path against a hosted workspace (the Shield Agent cloud service). One command. Free forever under MIT.
12
12
 
13
13
  ```bash
14
14
  npm i -g @shield-agent/kya@latest && kya start
@@ -25,13 +25,16 @@ Walkthrough: [how you use it](https://shield-agent.com/how-kya-works#using).
25
25
 
26
26
  ```bash
27
27
  npx @shield-agent/kya@latest --help
28
+ npx @shield-agent/kya@latest --version
28
29
  ```
29
30
 
31
+ `--version`, `-v`, `-V` and `kya version` print the installed package version on one line and exit `0`. They read the local package only: no network, no banner, no config.
32
+
30
33
  Requires **Node.js 22+** (`engines.node: >=22`); 24 is the recommended line. Node 20 and 21 are unsupported but work: the CLI prints a one-line warning. Node 18 and older are unsupported and some features break there (HTTP `serve-mcp`, the gateway OTLP receiver). Below 22 the CLI offers to install Node 24 for you (via volta / fnm / nvm / brew), reinstall itself, and finish the command. If you decline, it just prints the warning and continues. `kya hook` never warns or prompts.
31
34
 
32
35
  It works with any host that speaks MCP or OpenAPI. Vertical packs are optional. Shield is the only policy decision point (the one place that decides Allow or Deny). This gate never auto-approves an irreversible side effect (a change you cannot undo).
33
36
 
34
- If `KYA_API_KEY` is empty against an authenticated plane, network commands exit non-zero. `eval-tool`, `wrap`, and `invoke` exit `0` on ALLOW, `4` on REQUIRE_APPROVE, and `1` on DENY or unknown, so a line like `eval-tool && write` cannot skip the gate.
37
+ If `KYA_API_KEY` is empty against an authenticated plane, network commands exit non-zero. `eval-tool`, `wrap`, and `invoke` exit `0` on ALLOW, `4` on REQUIRE_APPROVE, and `1` on DENY or unknown, so a line like `eval-tool && write` cannot skip the gate. `wrap` runs in observe mode by default, so it exits `0` on REQUIRE_APPROVE too. Set `KYA_HOLD=1` or pass `--hold` to get the `4`.
35
38
 
36
39
  `--offline` runs sample evaluate without a paid cloud (useful for DENY and REQUIRE_APPROVE demos). Creating an agent is itself a tool: offline, `kya.agent.register` comes back REQUIRE_APPROVE. Allow, break-glass, and approve mint modes (the modes that create approvals) live on the control plane.
37
40
 
@@ -47,7 +50,7 @@ More ways to install (same package; npm stays the reference path):
47
50
 
48
51
  ```bash
49
52
  # Homebrew. Homebrew 7 may ask you to trust a third-party tap: run `brew tap The-Pixel-Boys/tap` first.
50
- # The formula installs about 270MB because of the optional semantic-search runtime.
53
+ # The formula does not install the semantic-search runtime. Search stays lexical until you opt in (see Natural-language search).
51
54
  brew install The-Pixel-Boys/tap/shield-kya
52
55
 
53
56
  # Scoop (not yet verified on Windows)
@@ -92,7 +95,7 @@ kya connect qwen --project # project scope instead of global
92
95
  kya connect kiro --force # overwrite an existing shield-kya entry
93
96
  ```
94
97
 
95
- Connect merges. It never rewrites a host config it cannot parse, and it keeps your other servers and keys. Supported hosts: `claude`, `grok`, `opencode`, `kilo`, `kiro`, `qwen`, `kimi`, `mastracode`, `amp`, `copilot`, `cursor`. Each wires `serve-mcp --stdio` with `KYA_OFFLINE=1` so the gate starts keyless (no API key). Set `KYA_API_KEY` in the host env when you point at an authenticated plane.
98
+ Connect merges. It never rewrites a host config it cannot parse, and it keeps your other servers and keys. Supported hosts: `claude`, `codex`, `grok`, `opencode`, `kilo`, `kiro`, `qwen`, `kimi`, `mastracode`, `amp`, `copilot`, `cursor`. Each wires `serve-mcp --stdio` with `KYA_OFFLINE=1` so the gate starts keyless (no API key). Set `KYA_API_KEY` in the host env when you point at an authenticated plane.
96
99
 
97
100
  Hosts without a `connect` target still work: `kya wrap --offline -- <agent command>` puts the same evaluate gate in front of any CLI. Per-host recipes with verify steps and troubleshooting live in [docs/hosts/](docs/hosts/).
98
101
 
@@ -119,7 +122,7 @@ This repo is also a Claude Code plugin marketplace named `shield-kya` with one p
119
122
  /plugin install kya@shield-kya
120
123
  ```
121
124
 
122
- The plugin is **advisory and fails open**: it records every tool call on the local record (`~/.kya/trail.jsonl`) and blocks only the small never-list. If kya is missing, crashes or times out, the tool call proceeds and nothing is recorded. It evaluates offline, so it has no Hold and no approval. Hosted enforcement is the MCP gate path.
125
+ The plugin is **advisory and fails open**: it records every tool call on the local record (`~/.kya/trail.jsonl`) and blocks only the small never-list. If kya is missing, crashes or times out, the tool call proceeds and nothing is recorded. It evaluates offline, so it has no Hold and no approval. Hosted enforcement is the MCP policy path against a hosted workspace.
123
126
 
124
127
  Team rollout: commit `extraKnownMarketplaces` (the `shield-kya` GitHub source) and `enabledPlugins` (`"kya@shield-kya": true`) to the repository's `.claude/settings.json`, or force it org-wide with managed settings. Details and limits: [docs/hosts/claude-plugin.md](docs/hosts/claude-plugin.md).
125
128
 
@@ -172,6 +175,8 @@ kya connect claude --gate # point the host at the gateway (server key shield-k
172
175
  kya gate doctor # binary, config, listener health, loopback-only posture
173
176
  ```
174
177
 
178
+ If another process already holds a default port (`port` 3930 or `otlpPort` 3931), `kya gate run` stops with `EADDRINUSE`. Set free ports in `.kya/gateways.json` (`port` and `otlpPort`), then run it again.
179
+
175
180
  `kya gate stop` stops the supervisor and the binary with it. Honest notes: `kya gate setup` (and `kya start`'s auto-bootstrap, only when it found servers to govern) downloads the pinned gateway binary from our releases. Nothing else downloads anything. The only other network use is the opt-in anonymous usage stats in [docs/telemetry.md](docs/telemetry.md), off unless you say yes. `run` never downloads. Observe mode means allowed calls are recorded, not blocked. The deny set above is the only hard stop, and plane enforcement stays with `kya.policy_evaluate`. `kya connect <host> --gate` covers the same hosts as plain `connect`. Grok gets a `[mcp_servers.shield-kya-gate]` url table in its config.toml (Grok supports remote MCP servers over HTTP). Per-server tiers and recipes: [docs/mcp-servers.md](docs/mcp-servers.md).
176
181
 
177
182
  ## Longer path (optional)
@@ -191,7 +196,7 @@ Install hub: [https://shield-agent.com/install](https://shield-agent.com/install
191
196
 
192
197
  ## Activity record (global)
193
198
 
194
- One record (trail) for all projects: `~/.kya/trail.jsonl` (`KYA_HOME` overrides `~`). `kya receipt --open` from any directory shows activity from every project. Each event carries its project folder name. The report adds a Projects rollup once two or more projects appear, and shows the project on each feed entry. Older per-project `<project>/.kya/trail.jsonl` files are still read and merged; no migration. The record is capped at 1 MB (tail-read: oldest events drop away) and shared across all projects.
199
+ One record (trail) for all projects: `~/.kya/trail.jsonl` (`KYA_HOME` overrides `~`). `kya receipt --open` from any directory shows activity from every project. Each event carries its project folder name. The report adds a Projects rollup once two or more projects appear, and shows the project on each feed entry. Older per-project `<project>/.kya/trail.jsonl` files are still read and merged; no migration. Reports read only the last 1 MB of the record (oldest events drop out of the view); it is shared across all projects.
195
200
 
196
201
  The report itself is a dashboard. A hero row on top shows the live **Certify** result, the decision mix, an activity sparkline, and showback (cost per agent). Tabbed sections sit below: **Overview** (analytics, sessions, reasons), **Certify** (the full live requirement table: every requirement grouped by domain with status, evidence, and attestation), **Activity** (the filterable event feed), **System** (wired hosts, sandboxes, ORR). Everything is one standalone offline HTML page. The live view adds a single external link: "Star on GitHub". The live daemon from `kya start` re-renders it on every event.
197
202
 
@@ -203,14 +208,37 @@ Sharing is a single attempt by design (storm-proof: no silent retries against th
203
208
 
204
209
  ### Natural-language search
205
210
 
206
- The **Activity** search box understands plain English. It runs a hybrid of BM25 over tool IDs, summaries, reason codes, decisions, projects, and MCP server labels, plus local MiniLM semantic reranking (shipped as an optional dependency; the report falls back to lexical-only if the model runtime is unavailable). A built-in concept glossary maps everyday words to the vocabulary events actually use, so `dangerous` finds rm/kill/delete/sudo calls, `blocked` finds denials, and `held` finds approval requests. You can also type things like `failed stripe transfers`, `files written by grok`, or `approval required production`. Stopwords and stemming are handled automatically, and the same search works across the global record.
211
+ The **Activity** search box understands plain English. It runs a hybrid of BM25 over tool IDs, summaries, reason codes, decisions, projects, and MCP server labels, plus local MiniLM semantic reranking, which is opt-in. The runtime is not part of the default install. Without it, search stays lexical (BM25) and the live report server writes one line to its log (for `kya start`, the background report daemon log) that names the install command. Install it once:
212
+
213
+ ```bash
214
+ # macOS and Linux (bash or zsh)
215
+ npm install --prefix "$HOME/.kya/semantic" @shield-agent/fastembed@3.0.0
216
+ ```
217
+
218
+ ```bat
219
+ :: Windows cmd
220
+ npm install --prefix "%USERPROFILE%\.kya\semantic" @shield-agent/fastembed@3.0.0
221
+ ```
222
+
223
+ ```powershell
224
+ # Windows PowerShell
225
+ npm install --prefix "$env:USERPROFILE\.kya\semantic" @shield-agent/fastembed@3.0.0
226
+ ```
227
+
228
+ If `KYA_HOME` is set, the prefix is `$KYA_HOME/.kya/semantic` (`%KYA_HOME%\.kya\semantic` on Windows). A built-in concept glossary maps everyday words to the vocabulary events actually use, so `dangerous` finds rm/kill/delete/sudo calls, `blocked` finds denials, and `held` finds approval requests. You can also type things like `failed stripe transfers`, `files written by grok`, or `approval required production`. Stopwords and stemming are handled automatically, and the same search works across the global record.
207
229
 
208
230
  - Offline or `KYA_OFFLINE=1` keeps search purely lexical (no model download).
209
- - By default the live server downloads `BAAI/bge-small-en-v1.5` once into `~/.kya/models` and caches event vectors in `~/.kya/search-index.json`.
231
+ - After you opt in, the live server downloads `BAAI/bge-small-en-v1.5` once into `~/.kya/models` and caches event vectors in `~/.kya/search-index.json`.
210
232
  - `KYA_SEARCH_SEMANTIC=off` disables the model while still keeping BM25.
211
233
 
212
234
  The hosted console uses the same hybrid search on the server side (Postgres full-text + optional OpenAI-compatible embeddings), so queries typed in either place behave the same way.
213
235
 
236
+ ## Upgrade notes
237
+
238
+ - Semantic search is no longer installed by default (about 230 MB less on disk). After upgrading, activity search is lexical (BM25) only until you run the install command in [Natural-language search](#natural-language-search).
239
+ - The CLI loads the OpenTelemetry SDK only when an OTLP endpoint is set. A start error is logged once to stderr; metrics stay off and the command continues.
240
+ - Hook verdicts and fail-open rules are unchanged.
241
+
214
242
  ## Dual plane
215
243
 
216
244
  ```
@@ -224,6 +252,22 @@ The hosted console uses the same hybrid search on the server side (Postgres full
224
252
 
225
253
  Tag sessions with `KYA_HOST=ide` or `KYA_HOST=runtime`. Same policy path either way.
226
254
 
255
+ ## Plans (hosted, plan tiers v2)
256
+
257
+ The rows below apply only when the hosted service turns plan tiers v2 on. Until then the hosted plans are Free, Starter, Pro and Scale.
258
+
259
+ The hosted console has these plans. The CLI works on every plan. Solo and the no-card trial appear only when the hosted service turns plan tiers on.
260
+
261
+ | Plan | Price | Seats | Trail history | Notes |
262
+ |---|---|---|---|---|
263
+ | Free | $0 | 2 | 30 days | Start here |
264
+ | Solo | $90 a year | 1 | 90 days | CSV evidence export. Yearly only |
265
+ | Team | $29 a month | 5 | 90 days | Formerly "Starter" |
266
+ | Pro | $149 a month | 25 | 90 days | Compliance report PDF, signed evidence bundles |
267
+ | Scale | $499 a month | Unlimited | 365 days | SSO and SCIM |
268
+
269
+ n8n and Zapier access is included in every paid plan. There is no add-on price.
270
+
227
271
  ## Environment
228
272
 
229
273
  | Variable | Required | Meaning |
@@ -242,6 +286,9 @@ Tag sessions with `KYA_HOST=ide` or `KYA_HOST=runtime`. Same policy path either
242
286
  | `KYA_SHARE_URL` | No | `kya receipt --share` collector base (default `https://shield-agent.com`) |
243
287
  | `KYA_TELEMETRY` | No | `0`/`off` forces anonymous usage stats off ([docs/telemetry.md](docs/telemetry.md)); they are off unless you opted in |
244
288
  | `DO_NOT_TRACK` | No | `1` forces anonymous usage stats off, same as `KYA_TELEMETRY=0` |
289
+ | `KYA_BASE_URL` | No | Hosted console for `kya login` (default `https://shield-agent.com`; https or loopback only) |
290
+ | `KYA_QUIET` | No | Any true value hides the one-line hosted calls to action (`kya certify`, `kya receipt`) |
291
+ | `KYA_CTA` | No | `0`/`off` turns off the one-line hosted calls to action ([docs/login.md](docs/login.md#calls-to-action-one-line)) |
245
292
 
246
293
  Gate mode can also be set in the project's `.kya/config.json`:
247
294
  `{"gateMode": "hold"}` or `{"gateMode": "offline"}` (exact values only;
@@ -265,7 +312,7 @@ MCP Registry entry: `server.json` plus package `mcpName` `io.github.The-Pixel-Bo
265
312
  "mcpServers": {
266
313
  "shield-kya": {
267
314
  "command": "npx",
268
- "args": ["--no-install", "@shield-agent/kya@0.32.6", "serve-mcp", "--stdio"],
315
+ "args": ["--no-install", "@shield-agent/kya@0.32.9", "serve-mcp", "--stdio"],
269
316
  "env": {
270
317
  "KYA_BASE_URL": "http://127.0.0.1:8090",
271
318
  "KYA_API_KEY": "${KYA_API_KEY}",
@@ -299,7 +346,9 @@ const run = governed({ toolId: "write_file", server: "filesystem", fn: myWrite }
299
346
  await run({ path: "out.txt", content: "hi" }); // throws KyaDeniedError on DENY
300
347
  ```
301
348
 
302
- Offline evaluate by default (no network, no hosted plane); an explicit config uses the live plane. `governA2aSend` gates in-process agent-to-agent sends. A fail-open Python shim with a LangChain middleware is in development and not yet released. Support matrix and recipes: `docs/sdk-integrations.md`; runnable scripts: `examples/sdk/`.
349
+ Offline evaluate by default (no network, no hosted plane); an explicit config uses the live plane. `governA2aSend` gates in-process agent-to-agent sends. The `shield-kya` Python package on PyPI ships framework hooks (LangChain, CrewAI, OpenAI Agents SDK and others), fail-open like `kya hook`. Support matrix and recipes: `docs/sdk-integrations.md`; runnable scripts: `examples/sdk/`.
350
+
351
+ Framework recipes (each one tested with a scripted model and the published CLI): [LangChain](docs/sdk-integrations.md#langchain-python) · [OpenAI Agents SDK](docs/sdk-integrations.md#openai-agents-sdk-python) · [CrewAI](docs/sdk-integrations.md#crewai-python) · [LlamaIndex](docs/sdk-integrations.md#llamaindex-python) · [Mastra](docs/sdk-integrations.md#mastra-typescript) · [Vercel AI SDK](docs/sdk-integrations.md#vercel-ai-sdk-typescript)
303
352
 
304
353
  ## Claude connector
305
354
 
@@ -307,7 +356,7 @@ Offline evaluate by default (no network, no hosted plane); an explicit config us
307
356
 
308
357
  ```bash
309
358
  # Prefer a preinstalled package (no registry auto-install):
310
- npx --no-install @shield-agent/kya@0.32.6 serve-mcp --stdio
359
+ npx --no-install @shield-agent/kya@0.32.9 serve-mcp --stdio
311
360
  # Or after npm i -g / local install:
312
361
  kya serve-mcp --stdio
313
362
  ```
@@ -318,7 +367,7 @@ Copy `claude/claude_desktop_config.example.json` into Claude Desktop MCP setting
318
367
 
319
368
  ## OpenAI (Codex / Responses)
320
369
 
321
- **Codex CLI plugin (hooks):** see [Codex plugin](#codex-plugin). **Codex CLI / IDE (MCP):** copy `openai/codex.config.example.toml` into `~/.codex/config.toml`. Local stdio uses `npx --no-install @shield-agent/kya@0.32.6 serve-mcp --stdio`. Hosted Codex uses `url = "https://shield-agent.com/mcp"` with `bearer_token_env_var = "KYA_API_KEY"`.
370
+ **Codex CLI plugin (hooks):** see [Codex plugin](#codex-plugin). **Codex CLI / IDE (MCP):** copy `openai/codex.config.example.toml` into `~/.codex/config.toml`. Local stdio uses `npx --no-install @shield-agent/kya@0.32.9 serve-mcp --stdio`. Hosted Codex uses `url = "https://shield-agent.com/mcp"` with `bearer_token_env_var = "KYA_API_KEY"`.
322
371
 
323
372
  **Responses API:** see `openai/responses-mcp.example.json` (`server_url` + `Authorization: Bearer <KYA_API_KEY>`).
324
373
 
@@ -491,6 +540,7 @@ pnpm build
491
540
  - [Top-20 MCP server support matrix (taxonomy + gate recipes)](docs/mcp-servers.md)
492
541
  - [OTLP metrics (OSS + hosted)](docs/otlp.md)
493
542
  - [Anonymous usage stats (opt-in): what is sent, controls, retention](docs/telemetry.md)
543
+ - [Link this machine to the hosted console (kya login)](docs/login.md)
494
544
  - [OWASP MCP governance map](docs/owasp-mcp-governance.md)
495
545
  - [Claude Code plugin](docs/hosts/claude-plugin.md) · [Copilot CLI plugin](docs/hosts/copilot.md#plugin) · [Codex plugin](docs/hosts/codex.md#codex-plugin) · [Gemini CLI extension](docs/hosts/gemini.md#gemini-cli-extension)
496
546
  - [Import the AGT audit log (CLI)](docs/import-agt.md) · [hosted](docs/import-agt-hosted.md)
@@ -503,6 +553,10 @@ pnpm build
503
553
  - [What is open source and what is hosted](docs/oss-vs-hosted.md)
504
554
  - See also `LIMITATIONS.md` in this repo
505
555
 
556
+ ## Hosted console (`kya login`, optional)
557
+
558
+ `kya login` links this machine to your hosted Shield KYA workspace. It uses the device code flow: the CLI shows a short code, you approve it in the hosted console, and the CLI saves a full-workspace API key with mode 0600 in `~/.kya/hosted-credentials.json`. `kya logout` deletes that file. It does not revoke the key on the server, so revoke it in the console too. The OSS CLI works without an account, and `kya certify` and the hook never read the saved key. Details, failure cases and the one-line calls to action: [docs/login.md](docs/login.md).
559
+
506
560
  ## Anonymous usage stats (opt-in, off by default)
507
561
 
508
562
  The first time you run `kya start`, `kya init` or `kya connect` in a terminal, KYA asks once whether to share anonymous usage stats (`[y/N]`, the default is No). Only an explicit `y` or `yes` turns it on. Nothing is sent in CI, in non-interactive runs, with `--json`, or when `DO_NOT_TRACK=1` / `KYA_TELEMETRY=0` is set. `kya hook` itself never touches the network; when you opted in it starts a detached helper at most once a day that sends one `ping`, so hook-only installs still count as active.
@@ -2,7 +2,7 @@
2
2
  "amp.mcpServers": {
3
3
  "shield-kya": {
4
4
  "command": "npx",
5
- "args": ["--no-install", "@shield-agent/kya@0.32.6", "serve-mcp", "--stdio"],
5
+ "args": ["--no-install", "@shield-agent/kya@0.32.9", "serve-mcp", "--stdio"],
6
6
  "env": {
7
7
  "KYA_BASE_URL": "https://shield-agent.com",
8
8
  "KYA_API_KEY": "${KYA_API_KEY}",
@@ -2,7 +2,7 @@
2
2
  "mcpServers": {
3
3
  "shield-kya": {
4
4
  "command": "npx",
5
- "args": ["--no-install", "@shield-agent/kya@0.32.6", "serve-mcp", "--stdio"],
5
+ "args": ["--no-install", "@shield-agent/kya@0.32.9", "serve-mcp", "--stdio"],
6
6
  "env": {
7
7
  "KYA_BASE_URL": "https://shield-agent.com",
8
8
  "KYA_API_KEY": "${KYA_API_KEY}",
@@ -2,7 +2,7 @@
2
2
  "mcpServers": {
3
3
  "shield-kya": {
4
4
  "command": "npx",
5
- "args": ["--no-install", "@shield-agent/kya@0.32.6", "serve-mcp", "--stdio"],
5
+ "args": ["--no-install", "@shield-agent/kya@0.32.9", "serve-mcp", "--stdio"],
6
6
  "env": {
7
7
  "KYA_BASE_URL": "https://shield-agent.com",
8
8
  "KYA_API_KEY": "${KYA_API_KEY}",
@@ -2,7 +2,7 @@
2
2
  "mcpServers": {
3
3
  "shield-kya": {
4
4
  "command": "npx",
5
- "args": ["--no-install", "@shield-agent/kya@0.32.6", "serve-mcp", "--stdio"],
5
+ "args": ["--no-install", "@shield-agent/kya@0.32.9", "serve-mcp", "--stdio"],
6
6
  "env": {
7
7
  "KYA_BASE_URL": "https://shield-agent.com",
8
8
  "KYA_API_KEY": "${KYA_API_KEY}",
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AA2PH,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1D,qGAAqG;IACrG,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACtD;AAWD,oGAAoG;AACpG,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED,+FAA+F;AAC/F,wBAAsB,MAAM,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,GAAE,KAAiB,EACrB,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,MAAM,CAAC,CA4uBjB"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AA2JH,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1D,qGAAqG;IACrG,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACtD;AAWD,oGAAoG;AACpG,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED,+FAA+F;AAC/F,wBAAsB,MAAM,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,GAAE,KAAiB,EACrB,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,MAAM,CAAC,CA20BjB"}