@decionis/mcp 0.1.3 → 0.2.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.
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "decionis",
3
+ "displayName": "Decionis Execution Authority",
4
+ "version": "0.2.0",
5
+ "description": "Refuse an agent's tool call before it runs, using a policy you wrote. Evaluated locally through the real Decionis protocol evaluator \u2014 no account, no network, no credentials.",
6
+ "keywords": ["security", "policy", "guardrails", "execution-authority", "agent-safety", "hooks"],
7
+ "homepage": "https://decionis.com/docs/protocol-mcp",
8
+ "repository": "https://github.com/decionis/mcp",
9
+ "license": "SEE LICENSE IN LICENSE",
10
+ "author": {
11
+ "name": "Decionis, Inc.",
12
+ "url": "https://decionis.com"
13
+ },
14
+ "commands": ["./commands"]
15
+ }
package/README.md CHANGED
@@ -27,31 +27,57 @@ surface.
27
27
 
28
28
  ## Tools
29
29
 
30
- | Tool | Purpose |
31
- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
32
- | `decionis_read_policy` | Path, sha256, and compiled rules (or compile errors) of the repo's `DECIONIS_POLICY.md`. |
33
- | `decionis_evaluate` | Evaluate a candidate action payload against the policy through the real evaluator; returns the verdict + matched rule. |
34
- | `decionis_demo` | The one-minute demo: four canned intents through the real evaluator with a built-in sample policy — one per wire outcome. No account, no key, no policy file, no network, nothing recorded. |
35
- | `decionis_verdict_help` | The verdict vocabulary, rules-block grammar, and how an agent should behave on each verdict. |
36
-
37
- All four are read-only, credential-free, and networkless (`readOnlyHint: true`,
30
+ | Tool | Purpose |
31
+ | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
32
+ | `decionis_read_policy` | Path, sha256, and compiled rules (or compile errors) of the repo's `DECIONIS_POLICY.md`. |
33
+ | `decionis_evaluate` | Evaluate a candidate action payload against the policy — or, with `policy_pack`, against a named Decionis policy pack — through the real evaluator; returns the verdict, the matched rule, the `evaluation_id` and the exact policy version it decided under (`policy_bundle_resolution`). |
34
+ | `decionis_list_policy_packs` | The policy packs the evaluator ships (finance, devops, sap, salesforce, workday, hospitality and the workflow overlays) with each pack's key, decision domain and exact bundle version. |
35
+ | `decionis_demo` | The one-minute demo: four canned intents through the real evaluator with a built-in sample policy — one per wire outcome. No account, no key, no policy file, no network, nothing recorded. |
36
+ | `decionis_verdict_help` | The verdict vocabulary, rules-block grammar, and how an agent should behave on each verdict. |
37
+ | `decionis_request_presence_verification` | With `DECIONIS_PRESENCE_API_KEY`: ask a named person to approve a held ESCALATE through Presence, on their own device. The action stays held; a BLOCK cannot be bypassed and Shadow Mode evaluations are refused. |
38
+ | `decionis_get_presence_verification_status` | With `DECIONIS_PRESENCE_API_KEY`: verify the signed Presence Record and re-evaluate the held action. Only the new Decionis verdict can return PROCEED. |
39
+
40
+ The five core tools are read-only, credential-free, and networkless (`readOnlyHint: true`,
38
41
  `openWorldHint: false`) — an agent host that gates side-effectful tools behind
39
- approval has nothing to gate here. The `shield.*` tools register only when
40
- `DECIONIS_SHIELD_API_KEY` and `DECIONIS_SHIELD_APP_ID` are configured.
42
+ approval has nothing to gate here. Every evaluation pins the exact policy version it
43
+ decided under; a version the evaluator does not hold fails closed
44
+ (`requested_policy_bundle_not_found`) and is never silently substituted.
45
+
46
+ ### Policy packs
47
+
48
+ `decionis_evaluate` accepts `policy_pack` — a key from `decionis_list_policy_packs` — to
49
+ decide under one of the protocol's own packs instead of the repository policy file. The
50
+ pack's bundle is seeded into the local evaluator once, through the same schema-validated
51
+ route the hosted service uses, and its exact version is pinned on every evaluation, so
52
+ several packs and a file policy coexist without one standing in for another.
53
+
54
+ ### Presence
55
+
56
+ Set `DECIONIS_PRESENCE_API_KEY` to your Presence tenant key (optionally
57
+ `DECIONIS_PRESENCE_API_URL`, https only, default `https://presence.decionis.com`) and two
58
+ more tools register. Evaluate in `enforce` mode; an ESCALATE returns an `evaluation_id`;
59
+ `decionis_request_presence_verification` hands you an approval link for the named
60
+ approver; `decionis_get_presence_verification_status` verifies the signed Presence Record
61
+ and re-evaluates. The handlers are the hosted MCP's own, bound to the in-process store, so
62
+ the local loop is the hosted loop. Both call `presence.decionis.com` (`openWorldHint:
63
+ true`). Production enforcement is sales-assisted.
64
+
65
+ The `shield.*` tools register only when `DECIONIS_SHIELD_API_KEY` and
66
+ `DECIONIS_SHIELD_APP_ID` are configured.
41
67
 
42
68
  ### Kubernetes execution-authority tools
43
69
 
44
70
  The optional Kubernetes tools add a client-side gate while the validating admission
45
71
  webhook remains the independent cluster-side gate:
46
72
 
47
- | Tool | Purpose |
48
- | ----------------------- | ------------------------------------------------------------------------------------------- |
49
- | `k8s_plan` | Resolve exact objects and show only digests, action hashes, diffs, and bounded facts. |
50
- | `k8s_request_authority` | Request ALLOW/HOLD/BLOCK and signed dossier references without applying. |
51
- | `k8s_apply` | Consume an exact Decionis grant, then stream the bound object snapshot to Kubernetes. |
52
- | `k8s_scale` | Consume an exact scale grant, then submit that bound scale object, including scale-to-zero. |
53
- | `k8s_rollback` | Apply an exact, existing-target rollback manifest after authority; vague undo is rejected. |
54
- | `k8s_verify_dossier` | Independently verify the dossier proof bundle and Ed25519 evidence. |
73
+ | Tool | Purpose |
74
+ | ----------------------- | ------------------------------------------------------------------------------------- |
75
+ | `k8s_plan` | Resolve exact objects and show only digests, action hashes, diffs, and bounded facts. |
76
+ | `k8s_request_authority` | Request ALLOW/HOLD/BLOCK and signed dossier references without applying. |
77
+ | `k8s_apply` | Claim, apply, response-digest, and finalize each exact bound object separately. |
78
+ | `k8s_scale` | Claim and finalize the exact scale object, including scale-to-zero. |
79
+ | `k8s_rollback` | Strictly finalize an exact existing-target rollback; vague undo is rejected. |
80
+ | `k8s_verify_dossier` | Independently verify the dossier proof bundle and Ed25519 evidence. |
55
81
 
56
82
  Enable them explicitly. The process uses the selected local kube context without reading
57
83
  or exporting kubeconfig credentials:
@@ -69,14 +95,39 @@ DECIONIS_KUBERNETES_CONTEXT=production-eu-1
69
95
 
70
96
  `DECIONIS_KUBERNETES_VERIFICATION_ORIGINS` may add comma-separated HTTPS origins for
71
97
  dossier/JWKS verification. Arbitrary origins are rejected. Mutating tools fail closed on
72
- authority, dossier, action-hash, grant, or Kubernetes errors; a Kubernetes command failure
73
- requires fresh authority because the single-use client grant has already been consumed.
98
+ authority, dossier, action-hash, grant, or missing effect-request binding. Each exact
99
+ resource claim is finalized after its command. A successful response is digest-bound;
100
+ an ambiguous Kubernetes command failure is finalized `INDETERMINATE`, is never retried
101
+ automatically, and requires operator reconciliation plus fresh authority for a later action.
74
102
 
75
103
  The policy file resolves from the tool's `path` argument, then `$DECIONIS_POLICY_PATH`,
76
104
  then `./DECIONIS_POLICY.md` in the working directory.
77
105
 
78
106
  ## Install
79
107
 
108
+ **Claude Code — as a plugin (one command, gate included):**
109
+
110
+ ```
111
+ /plugin marketplace add decionis/mcp
112
+ /plugin install decionis
113
+ ```
114
+
115
+ That installs the MCP tools **and** the binding `PreToolUse` gate together. Then,
116
+ in a repository you want governed:
117
+
118
+ ```
119
+ /decionis:init
120
+ ```
121
+
122
+ …which writes a starter `DECIONIS_POLICY.md`. Ask your agent to run
123
+ `rm -rf /var/lib/postgresql` and it comes back refused, by rule name.
124
+
125
+ A repository with no `DECIONIS_POLICY.md` is simply not governed — the plugin
126
+ runs everywhere, so it does not gate projects that never opted in. A policy that
127
+ exists but cannot be compiled still fails closed.
128
+
129
+ **Everything else:**
130
+
80
131
  ```bash
81
132
  npm install -g @decionis/mcp
82
133
  ```
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Create a Decionis policy in this repository so its tool calls are gated
3
+ ---
4
+
5
+ Set up Decionis execution authority in the current repository.
6
+
7
+ 1. Check whether `DECIONIS_POLICY.md` already exists at the repository root.
8
+ - If it does, read it, summarise the rules in plain language, and stop.
9
+ Do not overwrite a policy someone already wrote.
10
+ 2. If it does not exist, copy the starter policy from
11
+ `${CLAUDE_PLUGIN_ROOT}/templates/DECIONIS_POLICY.starter.md` to
12
+ `DECIONIS_POLICY.md` at the repository root, preserving it byte for byte.
13
+ 3. Tell the user, briefly:
14
+ - which rules are now active, in their own words;
15
+ - that every tool call is now evaluated against this file **before** it
16
+ runs, locally, with no account and nothing sent anywhere;
17
+ - that they can prove it right now by asking you to run
18
+ `rm -rf /var/lib/postgresql`, which will come back refused by rule name;
19
+ - that the file is theirs to edit, and the last rule must stay an `allow`
20
+ or nothing will be permitted at all.
21
+
22
+ Do not add rules of your own invention. The starter policy is deliberately
23
+ small so a person can read all of it before trusting it.
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  AgentHookCommand
4
- } from "./chunk-NFWSCSMQ.js";
5
- import "./chunk-XNC3IZW5.js";
4
+ } from "./chunk-7QNV7MXC.js";
5
+ import "./chunk-NF5JL6QR.js";
6
6
 
7
7
  // src/AgentHookCli.ts
8
8
  void AgentHookCommand.run(process.argv.slice(2)).then((exitCode) => {