agentgovern 2.6.0__tar.gz → 2.7.2__tar.gz
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.
- {agentgovern-2.6.0 → agentgovern-2.7.2}/CHANGELOG.md +78 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/PKG-INFO +31 -16
- {agentgovern-2.6.0 → agentgovern-2.7.2}/README.md +29 -13
- {agentgovern-2.6.0 → agentgovern-2.7.2}/RELEASING.md +15 -0
- agentgovern-2.7.2/agentgovern/_version.py +1 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/hook/data/hook.py +312 -32
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/hook/installer.py +54 -13
- {agentgovern-2.6.0 → agentgovern-2.7.2}/pyproject.toml +2 -3
- agentgovern-2.7.2/tests/hook/fixtures/hook_2_4_0_golden_outputs.json +779 -0
- agentgovern-2.7.2/tests/hook/test_hook_v2_nagt400.py +865 -0
- agentgovern-2.7.2/tests/hook/test_hook_v2_nagt400_compat.py +234 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_installer.py +245 -0
- agentgovern-2.6.0/agentgovern/_version.py +0 -1
- {agentgovern-2.6.0 → agentgovern-2.7.2}/.gitignore +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/LICENSE +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/__init__.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/__main__.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/client.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/exceptions.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/gate2.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/hook/__init__.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/hook/cli.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/hook/data/__init__.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/hook/drift.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/hook/settings.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/instrumentors/__init__.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/instrumentors/_base.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/instrumentors/langchain.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/instrumentors/langgraph.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentgovern/types.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentshield/__init__.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentshield/client.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/agentshield/types.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/examples/langgraph_credit_decision_agent.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/__init__.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/conftest.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/__init__.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/conftest.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/fixtures/claude_code_pretooluse_output_keys.json +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_bundled_hook.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_drift.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_hook_v2_context_snapshot.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_hook_v2_dispatch.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_hook_v2_outbox_queue.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_hook_v2_payload_extraction.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_hook_v2_payloads.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_hook_v2_remediation_message.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_hook_v2_system_message.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_hook_v2_timing_log.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_hook_v2_transcript_reading.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_hook_v2_turn_index.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_hook_v2_warn_verdict.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_matcher_coverage.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_settings.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/hook/test_tool_map_classification.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_base_instrumentor.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_client.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_evaluate_input.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_gate2_full_path.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_gate2_latency.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_gate2_verdict_handler.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_import_guard.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_instrument_langchain.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_langchain.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_langchain_1x_agent.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_langchain_gate1.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_langchain_gate2_callbacks.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_langgraph.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_nagt380_enforce_propagation.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_no_localhost_3000_config.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_no_localhost_3000_traffic.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_output_capture_contract.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_payload_schema.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_policy_engine_url.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_rate_limit_handling.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_register_contract.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_timestamp.py +0 -0
- {agentgovern-2.6.0 → agentgovern-2.7.2}/tests/test_version_consistency.py +0 -0
|
@@ -1,5 +1,83 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.7.2 — release date is the `sdk-v2.7.2` tag's (prepared 2026-10-19)
|
|
4
|
+
|
|
5
|
+
**`agentgovern hook uninstall` now leaves Claude Code's settings exactly as they were before the install.** The bundled Claude Code hook (2.5.0), the dependencies and the Python requirement (3.10 or later) are unchanged from 2.7.1. There is no need to reinstall the hook.
|
|
6
|
+
|
|
7
|
+
### Fix — the uninstall leaves nothing behind in settings.json (NAGT-391 F8)
|
|
8
|
+
|
|
9
|
+
- **The install-mode marker (`_agentgovern_install_mode`) is removed with the hook entries.** It was left in `~/.claude/settings.json`.
|
|
10
|
+
- **The backup the uninstall writes (`settings.json.bak`) is removed once the new settings are written.** Left behind, it was a copy of the settings that still registered the hook, and restoring it would have pointed Claude Code at a hook script the uninstall steps delete. If the write fails, the backup stays.
|
|
11
|
+
- Found by the install rehearsal workflow (`.github/workflows/guard-install-rehearsal.yml`), which installs and uninstalls on clean Linux, macOS and Windows runners and compares the home folder before and after.
|
|
12
|
+
|
|
13
|
+
## 2.7.1 — release date is the `sdk-v2.7.1` tag's (prepared 2026-10-16)
|
|
14
|
+
|
|
15
|
+
**Documentation and package metadata only. The code, its dependencies and the bundled Claude Code hook (2.5.0) are unchanged from 2.7.0.** There is no need to reinstall the hook.
|
|
16
|
+
|
|
17
|
+
### Fix — the links on PyPI work (NAGT-391 F2)
|
|
18
|
+
|
|
19
|
+
- **The project's Repository and Issues links pointed at a GitHub repository that is not public,** so they returned "not found" for everyone outside Zirahn. They are replaced by a **Support** link, https://zirahn.com/contact. The README's own links are corrected the same way.
|
|
20
|
+
|
|
21
|
+
### Fix — the README says which Python you need (NAGT-391 F2)
|
|
22
|
+
|
|
23
|
+
- **The install line now needs Python 3.10 or later and asks for `agentgovern>=2.7.0`.** On Python 3.9, such as the macOS system Python, an unpinned `pip install agentgovern` installed 2.5.0 without a word; the pinned line fails with "No matching distribution found" instead.
|
|
24
|
+
- **The Claude Code hook section says what each policy mode does,** and that a new organization starts with nothing in enforce mode. It said the hook enforces your policies, which read as if it always blocked.
|
|
25
|
+
|
|
26
|
+
## 2.7.0 — release date is the `sdk-v2.7.0` tag's (prepared 2026-10-16)
|
|
27
|
+
|
|
28
|
+
**The Claude Code hook bundled with this release is hook 2.5.0** (it was 2.4.0). Install it with `agentgovern hook install --force` after upgrading; see "Upgrading an existing install" in the README. Until you do, the hook you have keeps working exactly as before, and the AgentGovern server shows it a once-per-session notice that a newer hook is available.
|
|
29
|
+
|
|
30
|
+
**Python 3.10 or later and the dependencies (`httpx`, `pydantic`) are unchanged from 2.6.0.** The hook itself still runs on Python 3.9 or later.
|
|
31
|
+
|
|
32
|
+
### Change — you are told when Guard's rate limit lets a tool call through unchecked (hook 2.5.0, NAGT-400)
|
|
33
|
+
|
|
34
|
+
- **When your team's Guard rate limit is reached, Claude Code now shows:**
|
|
35
|
+
`AgentGovern: your team reached Guard's rate limit, so this tool call was not checked by Guard and was allowed. Please tell your team's AgentGovern admin.`
|
|
36
|
+
- **At most once a minute per session,** so a burst does not flood the terminal.
|
|
37
|
+
- **The tool call still proceeds,** as before, including with `AGENTGOVERN_FAIL_ACTION=deny`, which still applies only when the server cannot be reached at all.
|
|
38
|
+
- **Hook 2.4.0 and earlier wrote this only to the hook's debug output, which Claude Code does not show,** so a rate-limited tool call passed silently.
|
|
39
|
+
- The message is the hook's own text. Nothing from the server's response is shown.
|
|
40
|
+
|
|
41
|
+
### Change — the hook shows usage-limit notices (hook 2.5.0, NAGT-400)
|
|
42
|
+
|
|
43
|
+
- **When the AgentGovern server reports that your team has reached its Guard allowance or storage limit,** Claude Code shows that notice once per session.
|
|
44
|
+
- It goes through the same path as the out-of-date-hook notice, with the same cleaning and length limits. The two notices are tracked separately, so one never hides the other.
|
|
45
|
+
- **Nothing is blocked by it.** Guard keeps checking every tool call.
|
|
46
|
+
|
|
47
|
+
### Fix — block and warning messages name the policy that decided (hook 2.5.0, NAGT-401)
|
|
48
|
+
|
|
49
|
+
- **When one tool call fails several policies, the message now names the one that made the decision:** for a block, the first policy in *enforce* mode; for a warning, the first in *warn* or *alert* mode.
|
|
50
|
+
- **Hook 2.4.0 named the first failing policy whatever its mode,** so a block could name a policy that was only logging.
|
|
51
|
+
- **This needs a server that sends each policy's mode.** With an older server, the hook names the first failing policy, as before.
|
|
52
|
+
|
|
53
|
+
### Change — dropped background events are counted (hook 2.5.0, NAGT-400)
|
|
54
|
+
|
|
55
|
+
- **Prompts, tool results and the end of each Claude response** are sent in the background. When the server answers one of them with an error, it is still not retried, and it is now counted per session.
|
|
56
|
+
- **With `AGENTGOVERN_HOOK_VERBOSE=1`, the count is reported once per session,** the first time Claude finishes a response after an event was dropped. It goes to the hook's debug output only; nothing is shown in Claude Code.
|
|
57
|
+
|
|
58
|
+
### Change — three more kinds of session file
|
|
59
|
+
|
|
60
|
+
- The hook's per-session files in `~/.agentgovern/sessions` gain three kinds: the usage-notice marker, the rate-limit message timer and the dropped-event count.
|
|
61
|
+
- **They are cleaned up like the others,** after 30 days.
|
|
62
|
+
|
|
63
|
+
### Fix — `agentgovern hook install` gives Windows instructions in PowerShell (NAGT-418)
|
|
64
|
+
|
|
65
|
+
**What changed, on Windows only:**
|
|
66
|
+
- **Missing environment variables.** When `AGENTGOVERN_API_KEY` or `AGENTGOVERN_ACTOR_USER_ID` is not set, `hook install` now prints one runnable line per variable, `[Environment]::SetEnvironmentVariable('<NAME>', '<your-value>', 'User')`, and tells you to open a new PowerShell window. It used to suggest `$env:VAR = 'value'` and adding it to `$PROFILE`.
|
|
67
|
+
- **`agentgovern hook test`** gives the same advice when either variable is missing.
|
|
68
|
+
- **The two closing hints** (turn governance off for one session, or go back to v1 capture) are now PowerShell commands, for example
|
|
69
|
+
`try { $env:AGENTGOVERN_HOOK_MODE='off'; claude } finally { Remove-Item Env:AGENTGOVERN_HOOK_MODE }`.
|
|
70
|
+
They used to print the bash form `AGENTGOVERN_HOOK_MODE=off claude`, which is an error in PowerShell. The variable is set for that one run of `claude` and removed from the PowerShell window when `claude` exits. **Unlike the bash form, it does not restore an earlier value:** if you had already set `AGENTGOVERN_HOOK_MODE` in that window, it is unset afterwards. A value saved at User scope is not touched, and new windows still get it.
|
|
71
|
+
|
|
72
|
+
**What did not change:**
|
|
73
|
+
- **On macOS and Linux, the installer's output is unchanged.**
|
|
74
|
+
- **What the installer writes is unchanged** on every platform: the same hook file and the same `settings.json` entries.
|
|
75
|
+
- **These lines are printed, not run.** The installer does not set any environment variable for you.
|
|
76
|
+
|
|
77
|
+
**The Python command the hook is registered with is unchanged:** on Windows the installer still writes a bare `python` unless you pass `--python-command`. The dashboard's PowerShell install snippet now passes the virtual environment's own `python.exe` that way. The snippet is part of the dashboard, not of this package, and works with earlier SDK versions too, since `--python-command` is not new.
|
|
78
|
+
|
|
79
|
+
The README (shown on PyPI) now gives the PowerShell form of the one-session bypass next to the bash form.
|
|
80
|
+
|
|
3
81
|
## 2.6.0 — release date is the `sdk-v2.6.0` tag's
|
|
4
82
|
|
|
5
83
|
**The bundled Claude Code hook is unchanged: hook 2.4.0.** No `agentgovern hook install --force` is needed for this release.
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: agentgovern
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.7.2
|
|
4
4
|
Summary: Compliance-as-code middleware for agentic AI workflows.
|
|
5
5
|
Project-URL: Homepage, https://agentgovern.zirahn.com
|
|
6
|
-
Project-URL:
|
|
7
|
-
Project-URL: Issues, https://github.com/ahmedkhan-zirahn/agentgovern/issues
|
|
6
|
+
Project-URL: Support, https://zirahn.com/contact
|
|
8
7
|
Author-email: Ahmed Khan <ahmed.khan@zirahn.com>
|
|
9
8
|
License: MIT
|
|
10
9
|
License-File: LICENSE
|
|
@@ -44,14 +43,16 @@ Description-Content-Type: text/markdown
|
|
|
44
43
|
|
|
45
44
|
**Compliance-as-code for agentic AI workflows.**
|
|
46
45
|
|
|
47
|
-
> **Beta** — API may change before 1.0.
|
|
46
|
+
> **Beta** — API may change before 1.0. Report issues through [zirahn.com/contact](https://zirahn.com/contact).
|
|
48
47
|
|
|
49
48
|
AgentGovern intercepts AI agent actions, evaluates them against configurable compliance policies (the EU AI Act today; NIST AI RMF and ISO 42001 are on the roadmap — see the table below), and generates audit-ready evidence in near real-time. Tracking runs in a background thread and fails open. An `enforce`-mode block raises in your code (see *Enforcement modes* below for exactly what it stops). *(Corrected again 2026-10-03: the first correction said "the SDK blocks only if you enable Gate 2 `enforce` mode, where a block verdict raises `OutputBlocked`", which reads as if enforce mode halts an agent; through the integrations it does not — NAGT-380.)* This SDK auto-instruments LangChain and LangGraph; any other framework (CrewAI, OpenAI Agents and the rest) can report actions with `track_action()`. *(Corrected 2026-10-03: this said NIST AI RMF and ISO 42001 were supported, that the SDK never blocks, and that it instruments CrewAI and OpenAI Agents code.)*
|
|
50
49
|
|
|
51
50
|
## Install
|
|
52
51
|
|
|
52
|
+
Needs **Python 3.10 or later**. The macOS system Python is 3.9, which is too old: install a newer one first, from python.org or with Homebrew (`brew install python@3.12`). On 3.9 this command fails with "No matching distribution found" rather than installing an old release.
|
|
53
|
+
|
|
53
54
|
```bash
|
|
54
|
-
pip install "agentgovern[langchain]"
|
|
55
|
+
python3 -m pip install "agentgovern[langchain]>=2.7.0"
|
|
55
56
|
```
|
|
56
57
|
|
|
57
58
|
## Quickstart — LangChain
|
|
@@ -212,19 +213,25 @@ Enable policy packs from the [AgentGovern dashboard](https://agentgovern.zirahn.
|
|
|
212
213
|
**Policy engine address (2.4.0).** The default engine address is now the stable name
|
|
213
214
|
`https://engine.zirahn.com`. Versions 2.3.0 and earlier call `https://agentgovern.onrender.com`
|
|
214
215
|
directly. That address keeps working, so nothing breaks if you stay on an older version, but only
|
|
215
|
-
the stable name can follow the engine if it moves. Upgrade with `pip install --upgrade agentgovern`.
|
|
216
|
+
the stable name can follow the engine if it moves. Upgrade with `python3 -m pip install --upgrade "agentgovern>=2.7.0"`.
|
|
216
217
|
If you set `policy_engine_url` or `AGENTGOVERN_POLICY_ENGINE_URL` yourself, it still takes precedence.
|
|
217
218
|
|
|
218
219
|
## Claude Code Hook
|
|
219
220
|
|
|
220
221
|
The SDK ships a built-in CLI for installing the AgentGovern hook into Claude Code. The hook
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
checks every tool call against your tenant's policies before the tool runs. A policy in
|
|
223
|
+
**enforce** mode blocks the call and Claude Code shows the reason; **warn** lets it run and
|
|
224
|
+
shows a warning; **log** only records it. A new organization starts with no policy in enforce
|
|
225
|
+
mode. A tool AgentGovern doesn't yet have a specific classification for is still captured and
|
|
226
|
+
evaluated, tagged `action_type=unmapped_tool` rather than silently skipped.
|
|
225
227
|
|
|
226
228
|
### Install
|
|
227
229
|
|
|
230
|
+
**The simplest way is the dashboard:** on **Settings → Developers**, **Add Developer** gives an
|
|
231
|
+
install snippet for bash and PowerShell that checks for Python 3.10 or later, installs this
|
|
232
|
+
package into its own virtual environment, saves your two settings for new terminals, and runs
|
|
233
|
+
the command below. To do it by hand:
|
|
234
|
+
|
|
228
235
|
```bash
|
|
229
236
|
agentgovern hook install
|
|
230
237
|
```
|
|
@@ -242,7 +249,7 @@ reports it as already installed and changes nothing. Upgrade, read what is insta
|
|
|
242
249
|
reinstall with `--force`:
|
|
243
250
|
|
|
244
251
|
```bash
|
|
245
|
-
python3 -m pip install --upgrade agentgovern # or the extra you installed with, e.g. "agentgovern[langchain]"
|
|
252
|
+
python3 -m pip install --upgrade "agentgovern>=2.7.0" # or the extra you installed with, e.g. "agentgovern[langchain]>=2.7.0"
|
|
246
253
|
agentgovern hook status # note each line's cmd= value and the "Install mode" line
|
|
247
254
|
agentgovern hook install --force # plus the flags below, if status calls for them
|
|
248
255
|
agentgovern hook status # reports no [DRIFT] lines once the hook is current
|
|
@@ -268,7 +275,7 @@ Your environment variables are not touched. Restart any running Claude Code sess
|
|
|
268
275
|
|
|
269
276
|
```bash
|
|
270
277
|
python3 -m venv ~/.agentgovern-venv
|
|
271
|
-
~/.agentgovern-venv/bin/python -m pip install --upgrade agentgovern
|
|
278
|
+
~/.agentgovern-venv/bin/python -m pip install --upgrade "agentgovern>=2.7.0"
|
|
272
279
|
~/.agentgovern-venv/bin/agentgovern hook status
|
|
273
280
|
~/.agentgovern-venv/bin/agentgovern hook install --force # plus the flags status called for
|
|
274
281
|
```
|
|
@@ -287,9 +294,11 @@ the matcher is `*`, every tool — but only once `hook install --force` has rewr
|
|
|
287
294
|
|
|
288
295
|
```bash
|
|
289
296
|
export AGENTGOVERN_API_KEY="ag_prod_..." # Settings → API Keys
|
|
290
|
-
export AGENTGOVERN_ACTOR_USER_ID="<your-actor-id>" #
|
|
297
|
+
export AGENTGOVERN_ACTOR_USER_ID="<your-actor-id>" # Settings → Developers: your install snippet, or "Your actor ID" (see the hook README)
|
|
291
298
|
```
|
|
292
299
|
|
|
300
|
+
*(Corrected 2026-10-05, NAGT-379: the comment above named only the install snippet. Settings → Developers also shows the signed-in user's own **Your actor ID**, for running the hook yourself, and is shown when the workspace's workflow is Guard or Mixed.)*
|
|
301
|
+
|
|
293
302
|
### Subcommands
|
|
294
303
|
|
|
295
304
|
| Command | Description |
|
|
@@ -307,7 +316,13 @@ To skip governance for a session without removing the hook:
|
|
|
307
316
|
AGENTGOVERN_HOOK_MODE=off claude
|
|
308
317
|
```
|
|
309
318
|
|
|
310
|
-
|
|
319
|
+
In PowerShell (the variable is removed again when claude exits):
|
|
320
|
+
|
|
321
|
+
```powershell
|
|
322
|
+
try { $env:AGENTGOVERN_HOOK_MODE='off'; claude } finally { Remove-Item Env:AGENTGOVERN_HOOK_MODE }
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
`agentgovern hook install --help` lists the install options, and `agentgovern hook status` shows what is installed. The environment variables are in *Required env vars* and *Bypass* above.
|
|
311
326
|
|
|
312
327
|
## Design guarantees
|
|
313
328
|
|
|
@@ -319,8 +334,8 @@ See `packages/claude-hook/README.md` for the full option reference.
|
|
|
319
334
|
## Links
|
|
320
335
|
|
|
321
336
|
- **Dashboard:** https://agentgovern.zirahn.com
|
|
322
|
-
- **Documentation:**
|
|
323
|
-
- **
|
|
337
|
+
- **Documentation:** this README
|
|
338
|
+
- **Support and issues:** https://zirahn.com/contact
|
|
324
339
|
|
|
325
340
|
## License
|
|
326
341
|
|
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
**Compliance-as-code for agentic AI workflows.**
|
|
4
4
|
|
|
5
|
-
> **Beta** — API may change before 1.0.
|
|
5
|
+
> **Beta** — API may change before 1.0. Report issues through [zirahn.com/contact](https://zirahn.com/contact).
|
|
6
6
|
|
|
7
7
|
AgentGovern intercepts AI agent actions, evaluates them against configurable compliance policies (the EU AI Act today; NIST AI RMF and ISO 42001 are on the roadmap — see the table below), and generates audit-ready evidence in near real-time. Tracking runs in a background thread and fails open. An `enforce`-mode block raises in your code (see *Enforcement modes* below for exactly what it stops). *(Corrected again 2026-10-03: the first correction said "the SDK blocks only if you enable Gate 2 `enforce` mode, where a block verdict raises `OutputBlocked`", which reads as if enforce mode halts an agent; through the integrations it does not — NAGT-380.)* This SDK auto-instruments LangChain and LangGraph; any other framework (CrewAI, OpenAI Agents and the rest) can report actions with `track_action()`. *(Corrected 2026-10-03: this said NIST AI RMF and ISO 42001 were supported, that the SDK never blocks, and that it instruments CrewAI and OpenAI Agents code.)*
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
11
|
+
Needs **Python 3.10 or later**. The macOS system Python is 3.9, which is too old: install a newer one first, from python.org or with Homebrew (`brew install python@3.12`). On 3.9 this command fails with "No matching distribution found" rather than installing an old release.
|
|
12
|
+
|
|
11
13
|
```bash
|
|
12
|
-
pip install "agentgovern[langchain]"
|
|
14
|
+
python3 -m pip install "agentgovern[langchain]>=2.7.0"
|
|
13
15
|
```
|
|
14
16
|
|
|
15
17
|
## Quickstart — LangChain
|
|
@@ -170,19 +172,25 @@ Enable policy packs from the [AgentGovern dashboard](https://agentgovern.zirahn.
|
|
|
170
172
|
**Policy engine address (2.4.0).** The default engine address is now the stable name
|
|
171
173
|
`https://engine.zirahn.com`. Versions 2.3.0 and earlier call `https://agentgovern.onrender.com`
|
|
172
174
|
directly. That address keeps working, so nothing breaks if you stay on an older version, but only
|
|
173
|
-
the stable name can follow the engine if it moves. Upgrade with `pip install --upgrade agentgovern`.
|
|
175
|
+
the stable name can follow the engine if it moves. Upgrade with `python3 -m pip install --upgrade "agentgovern>=2.7.0"`.
|
|
174
176
|
If you set `policy_engine_url` or `AGENTGOVERN_POLICY_ENGINE_URL` yourself, it still takes precedence.
|
|
175
177
|
|
|
176
178
|
## Claude Code Hook
|
|
177
179
|
|
|
178
180
|
The SDK ships a built-in CLI for installing the AgentGovern hook into Claude Code. The hook
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
checks every tool call against your tenant's policies before the tool runs. A policy in
|
|
182
|
+
**enforce** mode blocks the call and Claude Code shows the reason; **warn** lets it run and
|
|
183
|
+
shows a warning; **log** only records it. A new organization starts with no policy in enforce
|
|
184
|
+
mode. A tool AgentGovern doesn't yet have a specific classification for is still captured and
|
|
185
|
+
evaluated, tagged `action_type=unmapped_tool` rather than silently skipped.
|
|
183
186
|
|
|
184
187
|
### Install
|
|
185
188
|
|
|
189
|
+
**The simplest way is the dashboard:** on **Settings → Developers**, **Add Developer** gives an
|
|
190
|
+
install snippet for bash and PowerShell that checks for Python 3.10 or later, installs this
|
|
191
|
+
package into its own virtual environment, saves your two settings for new terminals, and runs
|
|
192
|
+
the command below. To do it by hand:
|
|
193
|
+
|
|
186
194
|
```bash
|
|
187
195
|
agentgovern hook install
|
|
188
196
|
```
|
|
@@ -200,7 +208,7 @@ reports it as already installed and changes nothing. Upgrade, read what is insta
|
|
|
200
208
|
reinstall with `--force`:
|
|
201
209
|
|
|
202
210
|
```bash
|
|
203
|
-
python3 -m pip install --upgrade agentgovern # or the extra you installed with, e.g. "agentgovern[langchain]"
|
|
211
|
+
python3 -m pip install --upgrade "agentgovern>=2.7.0" # or the extra you installed with, e.g. "agentgovern[langchain]>=2.7.0"
|
|
204
212
|
agentgovern hook status # note each line's cmd= value and the "Install mode" line
|
|
205
213
|
agentgovern hook install --force # plus the flags below, if status calls for them
|
|
206
214
|
agentgovern hook status # reports no [DRIFT] lines once the hook is current
|
|
@@ -226,7 +234,7 @@ Your environment variables are not touched. Restart any running Claude Code sess
|
|
|
226
234
|
|
|
227
235
|
```bash
|
|
228
236
|
python3 -m venv ~/.agentgovern-venv
|
|
229
|
-
~/.agentgovern-venv/bin/python -m pip install --upgrade agentgovern
|
|
237
|
+
~/.agentgovern-venv/bin/python -m pip install --upgrade "agentgovern>=2.7.0"
|
|
230
238
|
~/.agentgovern-venv/bin/agentgovern hook status
|
|
231
239
|
~/.agentgovern-venv/bin/agentgovern hook install --force # plus the flags status called for
|
|
232
240
|
```
|
|
@@ -245,9 +253,11 @@ the matcher is `*`, every tool — but only once `hook install --force` has rewr
|
|
|
245
253
|
|
|
246
254
|
```bash
|
|
247
255
|
export AGENTGOVERN_API_KEY="ag_prod_..." # Settings → API Keys
|
|
248
|
-
export AGENTGOVERN_ACTOR_USER_ID="<your-actor-id>" #
|
|
256
|
+
export AGENTGOVERN_ACTOR_USER_ID="<your-actor-id>" # Settings → Developers: your install snippet, or "Your actor ID" (see the hook README)
|
|
249
257
|
```
|
|
250
258
|
|
|
259
|
+
*(Corrected 2026-10-05, NAGT-379: the comment above named only the install snippet. Settings → Developers also shows the signed-in user's own **Your actor ID**, for running the hook yourself, and is shown when the workspace's workflow is Guard or Mixed.)*
|
|
260
|
+
|
|
251
261
|
### Subcommands
|
|
252
262
|
|
|
253
263
|
| Command | Description |
|
|
@@ -265,7 +275,13 @@ To skip governance for a session without removing the hook:
|
|
|
265
275
|
AGENTGOVERN_HOOK_MODE=off claude
|
|
266
276
|
```
|
|
267
277
|
|
|
268
|
-
|
|
278
|
+
In PowerShell (the variable is removed again when claude exits):
|
|
279
|
+
|
|
280
|
+
```powershell
|
|
281
|
+
try { $env:AGENTGOVERN_HOOK_MODE='off'; claude } finally { Remove-Item Env:AGENTGOVERN_HOOK_MODE }
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
`agentgovern hook install --help` lists the install options, and `agentgovern hook status` shows what is installed. The environment variables are in *Required env vars* and *Bypass* above.
|
|
269
285
|
|
|
270
286
|
## Design guarantees
|
|
271
287
|
|
|
@@ -277,8 +293,8 @@ See `packages/claude-hook/README.md` for the full option reference.
|
|
|
277
293
|
## Links
|
|
278
294
|
|
|
279
295
|
- **Dashboard:** https://agentgovern.zirahn.com
|
|
280
|
-
- **Documentation:**
|
|
281
|
-
- **
|
|
296
|
+
- **Documentation:** this README
|
|
297
|
+
- **Support and issues:** https://zirahn.com/contact
|
|
282
298
|
|
|
283
299
|
## License
|
|
284
300
|
|
|
@@ -87,3 +87,18 @@ To re-run a publish after a failed run, trigger the workflow manually **from the
|
|
|
87
87
|
- the wheel's `METADATA` says 2.5.0;
|
|
88
88
|
- its bundled `hook.py` is hook 2.4.0, byte-identical to the tag commit's;
|
|
89
89
|
- each file's PyPI attestation names publisher `ZirahnAI/agentgovern`, workflow `publish-sdk.yml`, environment `pypi`, with a subject digest equal to the file's.
|
|
90
|
+
- **2026-10-04:** 2.6.0 was published by run `37233410794` from tag `sdk-v2.6.0` at `9539eaec` (pushed by Ahmed; Build 20:46:53–20:47:09Z, Publish 20:47:14–20:47:34Z; files uploaded 20:47:29Z and 20:47:31Z). Verified afterwards, read-only:
|
|
91
|
+
- the wheel and sdist sha256 match PyPI's digests (`be9fb7d5…`, `75016301…`);
|
|
92
|
+
- the wheel's `METADATA` says `Version: 2.6.0`, `Requires-Python: >=3.10`;
|
|
93
|
+
- its bundled `hook.py` is hook 2.4.0, byte-identical to the tag commit's;
|
|
94
|
+
- each file's PyPI attestation names publisher `ZirahnAI/agentgovern`, workflow `publish-sdk.yml`, environment `pypi`, with a subject digest equal to the file's;
|
|
95
|
+
- an unpinned install resolves 2.6.0 on Python 3.12 and 2.5.0 on Python 3.9.6 (`/usr/bin/python3`, macOS 15.8.1).
|
|
96
|
+
- **2026-10-16:** 2.7.0 was published by run `38849510745` from tag `sdk-v2.7.0` at `90a5d6db` (#947's merge). **The tag was pushed by Claude Code under Ahmed's explicit, one-time authorisation for this tag**; the push printed the tag ruleset's "Cannot create ref due to creations being restricted" line and created the tag (the admin bypass). Build 04:13:32–04:13:52Z, Publish 04:13:56–04:14:27Z; files uploaded 04:14:22Z and 04:14:23Z. Verified afterwards, read-only:
|
|
97
|
+
- the wheel and sdist sha256 match PyPI's digests (`57105511…`, `e266e7e9…`), compared with the run's own `dist` artifact;
|
|
98
|
+
- the wheel's `METADATA` says `Version: 2.7.0`, `Requires-Python: >=3.10`;
|
|
99
|
+
- its bundled `hook.py` is **hook 2.5.0**, sha256 `f43c3c95010120dd34e8a91982de11516d9d3c582b5e2fd4bb7791c8fa6ffec1`, byte-identical to the tag commit's;
|
|
100
|
+
- each file's PyPI attestation names publisher `ZirahnAI/agentgovern`, workflow `publish-sdk.yml`, environment `pypi`;
|
|
101
|
+
- a fresh Python 3.12 venv installing `agentgovern==2.7.0` from PyPI reports `__version__` 2.7.0, and `hook install` into a temporary HOME writes hook 2.5.0 with all four events OK (`hook test` not run: it calls production);
|
|
102
|
+
- Python 3.9.6 (`/usr/bin/python3`) resolves `agentgovern-2.5.0`;
|
|
103
|
+
- the hook version changed, so the released-hook manifest moved to 2.5.0 after the tag (NAGT-400 (c), #953, `b748b1f7`).
|
|
104
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.7.2"
|