aiactguard 0.1.0__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.
- aiactguard-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +21 -0
- aiactguard-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +13 -0
- aiactguard-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +7 -0
- aiactguard-0.1.0/.github/workflows/ci.yml +23 -0
- aiactguard-0.1.0/.github/workflows/publish.yml +42 -0
- aiactguard-0.1.0/.gitignore +13 -0
- aiactguard-0.1.0/CHANGELOG.md +35 -0
- aiactguard-0.1.0/CONTRIBUTING.md +35 -0
- aiactguard-0.1.0/LICENSE +21 -0
- aiactguard-0.1.0/PKG-INFO +137 -0
- aiactguard-0.1.0/README.md +109 -0
- aiactguard-0.1.0/agentguard-project-plan.md +162 -0
- aiactguard-0.1.0/aiactguard/__init__.py +7 -0
- aiactguard-0.1.0/aiactguard/adapters/__init__.py +0 -0
- aiactguard-0.1.0/aiactguard/adapters/claude_agent_sdk_adapter.py +69 -0
- aiactguard-0.1.0/aiactguard/adapters/crewai_adapter.py +69 -0
- aiactguard-0.1.0/aiactguard/adapters/langchain_adapter.py +92 -0
- aiactguard-0.1.0/aiactguard/core/__init__.py +0 -0
- aiactguard-0.1.0/aiactguard/core/approval.py +55 -0
- aiactguard-0.1.0/aiactguard/core/audit_logger.py +64 -0
- aiactguard-0.1.0/aiactguard/core/audit_summary.py +42 -0
- aiactguard-0.1.0/aiactguard/core/composite_risk.py +105 -0
- aiactguard-0.1.0/aiactguard/core/default_taxonomy.yaml +46 -0
- aiactguard-0.1.0/aiactguard/core/explainability.py +39 -0
- aiactguard-0.1.0/aiactguard/core/guard.py +148 -0
- aiactguard-0.1.0/aiactguard/core/questionnaire.py +22 -0
- aiactguard-0.1.0/aiactguard/core/risk_classifier.py +86 -0
- aiactguard-0.1.0/aiactguard/core/watch.py +90 -0
- aiactguard-0.1.0/aiactguard/mappings/__init__.py +0 -0
- aiactguard-0.1.0/aiactguard/mappings/iso_42001.py +61 -0
- aiactguard-0.1.0/aiactguard/mappings/nist_ai_rmf.py +58 -0
- aiactguard-0.1.0/aiactguard/plugins/__init__.py +4 -0
- aiactguard-0.1.0/aiactguard/plugins/base.py +28 -0
- aiactguard-0.1.0/aiactguard/plugins/registry.py +68 -0
- aiactguard-0.1.0/aiactguard/policy/__init__.py +0 -0
- aiactguard-0.1.0/aiactguard/policy/default_policy.yaml +7 -0
- aiactguard-0.1.0/aiactguard/policy/schema.py +68 -0
- aiactguard-0.1.0/aiactguard/reports/__init__.py +0 -0
- aiactguard-0.1.0/aiactguard/reports/conformity_checklist.py +114 -0
- aiactguard-0.1.0/aiactguard/reports/eu_registration.py +58 -0
- aiactguard-0.1.0/aiactguard/reports/fria.py +81 -0
- aiactguard-0.1.0/aiactguard/reports/gpai_transparency_card.py +56 -0
- aiactguard-0.1.0/aiactguard/reports/incident_report.py +61 -0
- aiactguard-0.1.0/aiactguard/reports/post_market_monitoring.py +58 -0
- aiactguard-0.1.0/aiactguard/reports/technical_documentation.py +88 -0
- aiactguard-0.1.0/aiactguard/storage/__init__.py +0 -0
- aiactguard-0.1.0/aiactguard/storage/base.py +45 -0
- aiactguard-0.1.0/aiactguard/storage/sqlite_store.py +133 -0
- aiactguard-0.1.0/aiactguard/testing/__init__.py +0 -0
- aiactguard-0.1.0/aiactguard/testing/fairness_scan.py +101 -0
- aiactguard-0.1.0/aiactguard/testing/red_team.py +169 -0
- aiactguard-0.1.0/docs/launch/blog_post.md +58 -0
- aiactguard-0.1.0/docs/launch/compliance_checked_badge.md +19 -0
- aiactguard-0.1.0/docs/launch/linkedin_post.md +29 -0
- aiactguard-0.1.0/docs/launch/show_hn_post.md +33 -0
- aiactguard-0.1.0/examples/claude_agent_sdk_quickstart.py +40 -0
- aiactguard-0.1.0/examples/composite_risk_pipeline.py +18 -0
- aiactguard-0.1.0/examples/crewai_quickstart.py +47 -0
- aiactguard-0.1.0/examples/fairness_scan.py +19 -0
- aiactguard-0.1.0/examples/generate_mappings.py +39 -0
- aiactguard-0.1.0/examples/generate_reports.py +55 -0
- aiactguard-0.1.0/examples/incident_and_transparency_reports.py +46 -0
- aiactguard-0.1.0/examples/langchain_quickstart.py +47 -0
- aiactguard-0.1.0/examples/plugins/example_gxp_plugin.py +59 -0
- aiactguard-0.1.0/examples/red_team_scan.py +28 -0
- aiactguard-0.1.0/examples/watch_with_escalation.py +34 -0
- aiactguard-0.1.0/pyproject.toml +44 -0
- aiactguard-0.1.0/tests/__init__.py +0 -0
- aiactguard-0.1.0/tests/test_approval.py +53 -0
- aiactguard-0.1.0/tests/test_audit_logger.py +68 -0
- aiactguard-0.1.0/tests/test_claude_agent_sdk_adapter.py +46 -0
- aiactguard-0.1.0/tests/test_claude_agent_sdk_adapter_live.py +75 -0
- aiactguard-0.1.0/tests/test_composite_risk.py +66 -0
- aiactguard-0.1.0/tests/test_core_audit_summary.py +31 -0
- aiactguard-0.1.0/tests/test_crewai_adapter.py +57 -0
- aiactguard-0.1.0/tests/test_crewai_adapter_live.py +58 -0
- aiactguard-0.1.0/tests/test_explainability.py +39 -0
- aiactguard-0.1.0/tests/test_fairness_scan.py +48 -0
- aiactguard-0.1.0/tests/test_guard.py +81 -0
- aiactguard-0.1.0/tests/test_langchain_adapter_live.py +77 -0
- aiactguard-0.1.0/tests/test_mappings_iso_42001.py +25 -0
- aiactguard-0.1.0/tests/test_mappings_nist_ai_rmf.py +24 -0
- aiactguard-0.1.0/tests/test_plugins.py +69 -0
- aiactguard-0.1.0/tests/test_red_team.py +71 -0
- aiactguard-0.1.0/tests/test_reports_conformity_checklist.py +58 -0
- aiactguard-0.1.0/tests/test_reports_eu_registration.py +31 -0
- aiactguard-0.1.0/tests/test_reports_fria.py +33 -0
- aiactguard-0.1.0/tests/test_reports_gpai_transparency_card.py +35 -0
- aiactguard-0.1.0/tests/test_reports_incident_report.py +37 -0
- aiactguard-0.1.0/tests/test_reports_post_market_monitoring.py +23 -0
- aiactguard-0.1.0/tests/test_reports_technical_documentation.py +48 -0
- aiactguard-0.1.0/tests/test_risk_classifier.py +22 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Something in AIActGuard isn't working as expected
|
|
4
|
+
title: ""
|
|
5
|
+
labels: bug
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**What happened**
|
|
9
|
+
|
|
10
|
+
**What you expected**
|
|
11
|
+
|
|
12
|
+
**Minimal reproduction** (a `watch()`-wrapped function or adapter setup that shows the issue)
|
|
13
|
+
|
|
14
|
+
```python
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Environment**
|
|
19
|
+
- AIActGuard version:
|
|
20
|
+
- Python version:
|
|
21
|
+
- Framework + version (LangChain/CrewAI/Claude Agent SDK), if relevant:
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: A module, adapter, or capability AIActGuard doesn't have yet
|
|
4
|
+
title: ""
|
|
5
|
+
labels: enhancement
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**What's missing**
|
|
9
|
+
|
|
10
|
+
**Which Article/module does it map to** (if applicable — see the README's module roadmap table)
|
|
11
|
+
|
|
12
|
+
**Would this be a good fit as a community plugin instead of core?**
|
|
13
|
+
See `aiactguard.plugins.Plugin` and [examples/plugins/example_gxp_plugin.py](../../examples/plugins/example_gxp_plugin.py) — jurisdiction- or industry-specific modules are usually a better fit as a plugin than as a core addition.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
**What this changes and why**
|
|
2
|
+
|
|
3
|
+
**Checklist**
|
|
4
|
+
- [ ] `pytest -q` passes locally
|
|
5
|
+
- [ ] New behavior has test coverage
|
|
6
|
+
- [ ] If this adds a module that drafts/flags/checks something: it's honest about what it can't infer (see the README's Scope section) rather than fabricating an answer
|
|
7
|
+
- [ ] README/CHANGELOG updated if this changes public behavior
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.10", "3.12"]
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: ${{ matrix.python-version }}
|
|
20
|
+
- name: Install dependencies
|
|
21
|
+
run: pip install -e ".[langchain,crewai,claude-agent-sdk,dev]"
|
|
22
|
+
- name: Run tests
|
|
23
|
+
run: pytest -q
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
name: Build distribution
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: actions/setup-python@v5
|
|
14
|
+
with:
|
|
15
|
+
python-version: "3.12"
|
|
16
|
+
- name: Install build
|
|
17
|
+
run: python -m pip install build
|
|
18
|
+
- name: Build sdist and wheel
|
|
19
|
+
run: python -m build
|
|
20
|
+
- name: Upload dist artifact
|
|
21
|
+
uses: actions/upload-artifact@v4
|
|
22
|
+
with:
|
|
23
|
+
name: dist
|
|
24
|
+
path: dist/
|
|
25
|
+
|
|
26
|
+
publish:
|
|
27
|
+
name: Publish to PyPI
|
|
28
|
+
needs: build
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
environment:
|
|
31
|
+
name: pypi
|
|
32
|
+
url: https://pypi.org/p/aiactguard
|
|
33
|
+
permissions:
|
|
34
|
+
id-token: write # required for PyPI trusted publishing (OIDC) — no API token needed
|
|
35
|
+
steps:
|
|
36
|
+
- name: Download dist artifact
|
|
37
|
+
uses: actions/download-artifact@v4
|
|
38
|
+
with:
|
|
39
|
+
name: dist
|
|
40
|
+
path: dist/
|
|
41
|
+
- name: Publish to PyPI
|
|
42
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. Format loosely follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
4
|
+
|
|
5
|
+
## [0.1.0] — Unreleased
|
|
6
|
+
|
|
7
|
+
Initial build: all 19 modules from the original project plan.
|
|
8
|
+
|
|
9
|
+
### Phase 1 — Core
|
|
10
|
+
- Risk classification engine against a configurable EU AI Act Annex III taxonomy
|
|
11
|
+
- Immutable, append-only audit trail (SQLite-backed by default)
|
|
12
|
+
- Human-in-the-loop approval gates with a multi-approver escalation chain and reasoned-override logging
|
|
13
|
+
- Explainability capture (chain-of-thought/rationale attached to audit records)
|
|
14
|
+
- Policy-as-code (YAML gate rules)
|
|
15
|
+
- Framework adapters: LangChain, CrewAI, Claude Agent SDK
|
|
16
|
+
- `@watch` decorator for framework-agnostic integration
|
|
17
|
+
|
|
18
|
+
### Phase 2 — Documentation & assessment tooling
|
|
19
|
+
- Technical documentation generator (Art. 11 / Annex IV)
|
|
20
|
+
- Conformity readiness checklist (Art. 43)
|
|
21
|
+
- FRIA template generator (Art. 27)
|
|
22
|
+
- Post-market monitoring plan generator (Art. 72)
|
|
23
|
+
- EU database registration data prep (Art. 71)
|
|
24
|
+
|
|
25
|
+
### Phase 3 — Robustness & incident tooling
|
|
26
|
+
- Adversarial/red-team test harness (Art. 15)
|
|
27
|
+
- Bias & fairness scan (Art. 10)
|
|
28
|
+
- Serious incident report drafter (Art. 73)
|
|
29
|
+
- GPAI transparency card generator (Art. 53)
|
|
30
|
+
|
|
31
|
+
### Phase 4 — Multi-agent & multi-standard extensions
|
|
32
|
+
- Composite-system risk aggregation across multi-step pipelines
|
|
33
|
+
- NIST AI RMF mapping layer
|
|
34
|
+
- ISO/IEC 42001 mapping layer
|
|
35
|
+
- Plugin architecture (`aiactguard.plugins`) with entry-point discovery for community modules
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Contributing to AIActGuard
|
|
2
|
+
|
|
3
|
+
## Setup
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
git clone https://github.com/NavikkumarModi/AIActGuard.git
|
|
7
|
+
cd AIActGuard
|
|
8
|
+
python3 -m venv .venv
|
|
9
|
+
.venv/bin/pip install -e ".[langchain,crewai,claude-agent-sdk,dev]"
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Running tests
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
.venv/bin/pytest -q
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Tests for the CrewAI and Claude Agent SDK adapters are duck-typed against those frameworks' object shapes, so they run without the frameworks installed. Tests that need a real framework install (see `tests/*_live.py`) skip themselves via `pytest.importorskip` if it's missing locally — CI installs everything so they always run there.
|
|
19
|
+
|
|
20
|
+
## Design principles (read before adding a module)
|
|
21
|
+
|
|
22
|
+
- **Draft, flag, or check — never certify.** Every module in this project is explicit that it doesn't perform a legal or formal determination (conformity assessment, prohibited-practice determination, etc.). See the README's Scope section for the current boundary list.
|
|
23
|
+
- **Show what you can't infer, don't fabricate it.** Report generators take a `questionnaire` dict for fields the code can't know (system description, who's affected, intended purpose) and render a visible `NEEDS INPUT` marker when one's missing — see `aiactguard/core/questionnaire.py`. Follow this pattern for new report-style modules.
|
|
24
|
+
- **Dependency-light.** Core (`aiactguard/core/`, `aiactguard/policy/`, `aiactguard/storage/`) has no framework dependencies. Adapters for specific frameworks (`aiactguard/adapters/`) are duck-typed against the target framework's object shapes where possible (see `crewai_adapter.py`, `claude_agent_sdk_adapter.py`) rather than hard-importing it, so the rest of the library stays installable without every framework pulled in.
|
|
25
|
+
- **Reuse `GuardCore`.** Any new integration surface that needs to classify → gate → log an action should go through `aiactguard.core.guard.GuardCore`, not reimplement that sequence — see how the existing adapters use it.
|
|
26
|
+
|
|
27
|
+
## Adding a jurisdiction- or industry-specific module
|
|
28
|
+
|
|
29
|
+
Most likely this belongs as a **plugin**, not a core addition — see the README's "Writing a plugin" section and [examples/plugins/example_gxp_plugin.py](examples/plugins/example_gxp_plugin.py). Core stays scoped to the EU AI Act; plugins are where GxP, financial-services, or other domain-specific modules live.
|
|
30
|
+
|
|
31
|
+
## Before submitting a PR
|
|
32
|
+
|
|
33
|
+
- Open an issue first for anything non-trivial, so we can agree on scope before you write code.
|
|
34
|
+
- Run the full test suite.
|
|
35
|
+
- Update the README's module roadmap table or Contributing section if you're adding user-facing behavior.
|
aiactguard-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AIActGuard Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aiactguard
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Drop-in EU AI Act compliance middleware for agentic AI frameworks — audit trails, risk classification, and human-approval gates in one decorator.
|
|
5
|
+
Project-URL: Homepage, https://github.com/NavikkumarModi/AIActGuard
|
|
6
|
+
Project-URL: Issues, https://github.com/NavikkumarModi/AIActGuard/issues
|
|
7
|
+
Project-URL: Changelog, https://github.com/NavikkumarModi/AIActGuard/blob/main/CHANGELOG.md
|
|
8
|
+
Author-email: Navik Modi <navikkumarmodi@googlemail.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agentic-ai,audit,compliance,eu-ai-act,governance,langchain
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Requires-Dist: pyyaml>=6.0
|
|
19
|
+
Provides-Extra: claude-agent-sdk
|
|
20
|
+
Requires-Dist: claude-agent-sdk>=0.1; extra == 'claude-agent-sdk'
|
|
21
|
+
Provides-Extra: crewai
|
|
22
|
+
Requires-Dist: crewai>=0.70; extra == 'crewai'
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
25
|
+
Provides-Extra: langchain
|
|
26
|
+
Requires-Dist: langchain-core>=0.2; extra == 'langchain'
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# AIActGuard
|
|
30
|
+
|
|
31
|
+
**Drop-in EU AI Act compliance for any agent framework — audit trails, risk classification, and human-approval gates in one decorator.**
|
|
32
|
+
|
|
33
|
+
[](LICENSE)
|
|
34
|
+
[](pyproject.toml)
|
|
35
|
+
[](#)
|
|
36
|
+
|
|
37
|
+
AIActGuard is a lightweight middleware layer that any existing agent stack can adopt without ripping out its framework. It is **not** another agent orchestrator — it makes the one you already use (LangChain, CrewAI, AutoGen, ...) compliant.
|
|
38
|
+
|
|
39
|
+
> Each module logs, drafts, tests, or flags something concrete. None of them certify compliance on their own — that's a legal determination. See [Scope](#scope) below.
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install aiactguard[langchain]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Quickstart
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
from aiactguard.adapters.langchain_adapter import AIActGuardCallbackHandler
|
|
51
|
+
from aiactguard.core.approval import ApprovalContext, ApprovalDecision
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def compliance_officer(ctx: ApprovalContext) -> ApprovalDecision:
|
|
55
|
+
approved = input(f"Approve {ctx.action} ({ctx.risk_tier.value})? [y/N] ").lower() == "y"
|
|
56
|
+
return ApprovalDecision(approved=approved, approver_id="compliance_officer")
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
guard = AIActGuardCallbackHandler(
|
|
60
|
+
category="essential_services",
|
|
61
|
+
approvers=[compliance_officer], # an escalation chain — add more to route to a fallback
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
agent_executor.invoke({"input": "..."}, config={"callbacks": [guard]})
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
See [examples/](examples/) for full runnable examples: [LangChain](examples/langchain_quickstart.py), [CrewAI](examples/crewai_quickstart.py), [Claude Agent SDK](examples/claude_agent_sdk_quickstart.py), the framework-agnostic [`@watch` decorator with an escalation chain + override](examples/watch_with_escalation.py), [generating all five Phase 2 compliance reports](examples/generate_reports.py) from an audit trail, [running the red-team scenario harness](examples/red_team_scan.py), [a fairness scan](examples/fairness_scan.py), [drafting an incident report + GPAI transparency card](examples/incident_and_transparency_reports.py), [composite-system risk aggregation](examples/composite_risk_pipeline.py), [NIST/ISO mappings](examples/generate_mappings.py), and [a worked community plugin](examples/plugins/example_gxp_plugin.py).
|
|
68
|
+
|
|
69
|
+
## Module roadmap
|
|
70
|
+
|
|
71
|
+
All 19 modules from the original project plan are built — see [Scope](#scope) for what's deliberately excluded.
|
|
72
|
+
|
|
73
|
+
### Core (Phase 1)
|
|
74
|
+
|
|
75
|
+
| # | Module | Article(s) | What it does | Status |
|
|
76
|
+
|---|---|---|---|---|
|
|
77
|
+
| 1 | Risk classification engine | Art. 6, Annex III | Tags each agent action/tool call against EU AI Act risk tiers using a configurable taxonomy across all eight Annex III high-risk categories | ✅ |
|
|
78
|
+
| 2 | Immutable audit trail | Art. 12 | Every decision, tool call, input/output, model version, and timestamp logged to an append-only store | ✅ |
|
|
79
|
+
| 3 | Human-in-the-loop approval gates | Art. 14 | Configurable interrupt points that pause execution before a high-risk action fires, with an escalation chain of approvers and reasoned-override logging | ✅ |
|
|
80
|
+
| 4 | Explainability capture | Art. 13 | Structures the agent's chain-of-thought/tool-selection rationale into an auditor-readable format | ✅ |
|
|
81
|
+
| 5 | Framework adapters | — | LangChain ✅, CrewAI ✅, Claude Agent SDK ✅ — LangGraph, AutoGen, OpenAI Agents SDK pending | 🚧 |
|
|
82
|
+
| 6 | Policy-as-code | — | YAML rules defining what counts as high-risk for a given org and what triggers a human gate | ✅ |
|
|
83
|
+
|
|
84
|
+
### Documentation & assessment tooling (Phase 2)
|
|
85
|
+
|
|
86
|
+
| # | Module | Article(s) | What it does | Status |
|
|
87
|
+
|---|---|---|---|---|
|
|
88
|
+
| 7 | Technical documentation generator | Art. 11, Annex IV | Auto-drafts the Annex IV technical file from audit logs + a guided questionnaire | ✅ |
|
|
89
|
+
| 8 | Conformity readiness checklist | Art. 43 | Gap-analysis against Annex IV/VI requirements — a pre-assessment aid, not the assessment itself | ✅ |
|
|
90
|
+
| 9 | FRIA template generator | Art. 27 | Pre-fills a Fundamental Rights Impact Assessment draft from risk classification and deployment context | ✅ |
|
|
91
|
+
| 10 | Post-market monitoring plan generator | Art. 72 | Monitoring plan template scaffolded from risk tier and logged incident categories | ✅ |
|
|
92
|
+
| 11 | EU database registration data prep | Art. 71 | Auto-compiles the metadata the Art. 71 registration form requires — filing stays manual | ✅ |
|
|
93
|
+
|
|
94
|
+
### Robustness & incident tooling (Phase 3)
|
|
95
|
+
|
|
96
|
+
| # | Module | Article(s) | What it does | Status |
|
|
97
|
+
|---|---|---|---|---|
|
|
98
|
+
| 12 | Adversarial/red-team test harness | Art. 15 | Runs prompt-injection, jailbreak, and edge-case scenarios against your agent — heuristic detection, not semantic judgment | ✅ |
|
|
99
|
+
| 13 | Bias & fairness scan | Art. 10 | Statistical checks on agent decisions across a caller-supplied protected-characteristic proxy, at runtime | ✅ |
|
|
100
|
+
| 14 | Serious incident report drafter | Art. 73 | Turns a flagged incident into a structured draft for human review before filing | ✅ |
|
|
101
|
+
| 15 | GPAI transparency card generator | Art. 53 | Auto-generates a model transparency summary from config + usage patterns | ✅ |
|
|
102
|
+
|
|
103
|
+
### Multi-agent & multi-standard extensions (Phase 4 — differentiators)
|
|
104
|
+
|
|
105
|
+
| # | Module | What it does | Status |
|
|
106
|
+
|---|---|---|---|
|
|
107
|
+
| 16 | Composite-system risk aggregation | Flags when multiple individually low-risk agents, composed into a pipeline, cross into high-risk territory as a system | ✅ |
|
|
108
|
+
| 17 | NIST AI RMF mapping layer | Maps audit/risk data to NIST AI RMF's Govern/Map/Measure/Manage functions | ✅ |
|
|
109
|
+
| 18 | ISO/IEC 42001 mapping layer | Maps the same data to ISO 42001 AI management system clauses | ✅ |
|
|
110
|
+
| 19 | Plugin architecture for community modules | Defined interface for jurisdiction- or industry-specific community modules | ✅ |
|
|
111
|
+
|
|
112
|
+
## Scope
|
|
113
|
+
|
|
114
|
+
**Explicitly out of scope, and why:**
|
|
115
|
+
|
|
116
|
+
- **Prohibited-practice determination (Title II)** — legal judgment call, not a runtime check
|
|
117
|
+
- **Conformity assessment / CE marking itself** — requires formal procedures, sometimes a notified body; the toolkit preps evidence, it doesn't perform the assessment
|
|
118
|
+
- **Quality management system (Art. 17)** — an organizational process, not code
|
|
119
|
+
- **GPAI systemic-risk evaluation (Art. 55)** — applies to frontier model providers, not agent builders
|
|
120
|
+
- **Actual legal filing/registration submission** — data prep is automated, submission is not
|
|
121
|
+
|
|
122
|
+
## Contributing
|
|
123
|
+
|
|
124
|
+
Contributions are welcome, especially jurisdiction- or industry-specific modules. Open an issue to discuss before submitting a large PR.
|
|
125
|
+
|
|
126
|
+
**Writing a plugin:** implement `aiactguard.plugins.Plugin` — a `name`, a `description`, and a `generate(logger, *, questionnaire=None, **kwargs) -> str` method (the same shape every built-in report/mapping already has). See [examples/plugins/example_gxp_plugin.py](examples/plugins/example_gxp_plugin.py) for a worked example. To publish one for others to auto-discover, register it under the `aiactguard.plugins` entry-point group in your own package's `pyproject.toml`:
|
|
127
|
+
|
|
128
|
+
```toml
|
|
129
|
+
[project.entry-points."aiactguard.plugins"]
|
|
130
|
+
gxp = "aiactguard_gxp_plugin:plugin"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Callers pick it up with `aiactguard.plugins.discover_entry_points()`.
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# AIActGuard
|
|
2
|
+
|
|
3
|
+
**Drop-in EU AI Act compliance for any agent framework — audit trails, risk classification, and human-approval gates in one decorator.**
|
|
4
|
+
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](pyproject.toml)
|
|
7
|
+
[](#)
|
|
8
|
+
|
|
9
|
+
AIActGuard is a lightweight middleware layer that any existing agent stack can adopt without ripping out its framework. It is **not** another agent orchestrator — it makes the one you already use (LangChain, CrewAI, AutoGen, ...) compliant.
|
|
10
|
+
|
|
11
|
+
> Each module logs, drafts, tests, or flags something concrete. None of them certify compliance on their own — that's a legal determination. See [Scope](#scope) below.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install aiactguard[langchain]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quickstart
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
from aiactguard.adapters.langchain_adapter import AIActGuardCallbackHandler
|
|
23
|
+
from aiactguard.core.approval import ApprovalContext, ApprovalDecision
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def compliance_officer(ctx: ApprovalContext) -> ApprovalDecision:
|
|
27
|
+
approved = input(f"Approve {ctx.action} ({ctx.risk_tier.value})? [y/N] ").lower() == "y"
|
|
28
|
+
return ApprovalDecision(approved=approved, approver_id="compliance_officer")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
guard = AIActGuardCallbackHandler(
|
|
32
|
+
category="essential_services",
|
|
33
|
+
approvers=[compliance_officer], # an escalation chain — add more to route to a fallback
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
agent_executor.invoke({"input": "..."}, config={"callbacks": [guard]})
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
See [examples/](examples/) for full runnable examples: [LangChain](examples/langchain_quickstart.py), [CrewAI](examples/crewai_quickstart.py), [Claude Agent SDK](examples/claude_agent_sdk_quickstart.py), the framework-agnostic [`@watch` decorator with an escalation chain + override](examples/watch_with_escalation.py), [generating all five Phase 2 compliance reports](examples/generate_reports.py) from an audit trail, [running the red-team scenario harness](examples/red_team_scan.py), [a fairness scan](examples/fairness_scan.py), [drafting an incident report + GPAI transparency card](examples/incident_and_transparency_reports.py), [composite-system risk aggregation](examples/composite_risk_pipeline.py), [NIST/ISO mappings](examples/generate_mappings.py), and [a worked community plugin](examples/plugins/example_gxp_plugin.py).
|
|
40
|
+
|
|
41
|
+
## Module roadmap
|
|
42
|
+
|
|
43
|
+
All 19 modules from the original project plan are built — see [Scope](#scope) for what's deliberately excluded.
|
|
44
|
+
|
|
45
|
+
### Core (Phase 1)
|
|
46
|
+
|
|
47
|
+
| # | Module | Article(s) | What it does | Status |
|
|
48
|
+
|---|---|---|---|---|
|
|
49
|
+
| 1 | Risk classification engine | Art. 6, Annex III | Tags each agent action/tool call against EU AI Act risk tiers using a configurable taxonomy across all eight Annex III high-risk categories | ✅ |
|
|
50
|
+
| 2 | Immutable audit trail | Art. 12 | Every decision, tool call, input/output, model version, and timestamp logged to an append-only store | ✅ |
|
|
51
|
+
| 3 | Human-in-the-loop approval gates | Art. 14 | Configurable interrupt points that pause execution before a high-risk action fires, with an escalation chain of approvers and reasoned-override logging | ✅ |
|
|
52
|
+
| 4 | Explainability capture | Art. 13 | Structures the agent's chain-of-thought/tool-selection rationale into an auditor-readable format | ✅ |
|
|
53
|
+
| 5 | Framework adapters | — | LangChain ✅, CrewAI ✅, Claude Agent SDK ✅ — LangGraph, AutoGen, OpenAI Agents SDK pending | 🚧 |
|
|
54
|
+
| 6 | Policy-as-code | — | YAML rules defining what counts as high-risk for a given org and what triggers a human gate | ✅ |
|
|
55
|
+
|
|
56
|
+
### Documentation & assessment tooling (Phase 2)
|
|
57
|
+
|
|
58
|
+
| # | Module | Article(s) | What it does | Status |
|
|
59
|
+
|---|---|---|---|---|
|
|
60
|
+
| 7 | Technical documentation generator | Art. 11, Annex IV | Auto-drafts the Annex IV technical file from audit logs + a guided questionnaire | ✅ |
|
|
61
|
+
| 8 | Conformity readiness checklist | Art. 43 | Gap-analysis against Annex IV/VI requirements — a pre-assessment aid, not the assessment itself | ✅ |
|
|
62
|
+
| 9 | FRIA template generator | Art. 27 | Pre-fills a Fundamental Rights Impact Assessment draft from risk classification and deployment context | ✅ |
|
|
63
|
+
| 10 | Post-market monitoring plan generator | Art. 72 | Monitoring plan template scaffolded from risk tier and logged incident categories | ✅ |
|
|
64
|
+
| 11 | EU database registration data prep | Art. 71 | Auto-compiles the metadata the Art. 71 registration form requires — filing stays manual | ✅ |
|
|
65
|
+
|
|
66
|
+
### Robustness & incident tooling (Phase 3)
|
|
67
|
+
|
|
68
|
+
| # | Module | Article(s) | What it does | Status |
|
|
69
|
+
|---|---|---|---|---|
|
|
70
|
+
| 12 | Adversarial/red-team test harness | Art. 15 | Runs prompt-injection, jailbreak, and edge-case scenarios against your agent — heuristic detection, not semantic judgment | ✅ |
|
|
71
|
+
| 13 | Bias & fairness scan | Art. 10 | Statistical checks on agent decisions across a caller-supplied protected-characteristic proxy, at runtime | ✅ |
|
|
72
|
+
| 14 | Serious incident report drafter | Art. 73 | Turns a flagged incident into a structured draft for human review before filing | ✅ |
|
|
73
|
+
| 15 | GPAI transparency card generator | Art. 53 | Auto-generates a model transparency summary from config + usage patterns | ✅ |
|
|
74
|
+
|
|
75
|
+
### Multi-agent & multi-standard extensions (Phase 4 — differentiators)
|
|
76
|
+
|
|
77
|
+
| # | Module | What it does | Status |
|
|
78
|
+
|---|---|---|---|
|
|
79
|
+
| 16 | Composite-system risk aggregation | Flags when multiple individually low-risk agents, composed into a pipeline, cross into high-risk territory as a system | ✅ |
|
|
80
|
+
| 17 | NIST AI RMF mapping layer | Maps audit/risk data to NIST AI RMF's Govern/Map/Measure/Manage functions | ✅ |
|
|
81
|
+
| 18 | ISO/IEC 42001 mapping layer | Maps the same data to ISO 42001 AI management system clauses | ✅ |
|
|
82
|
+
| 19 | Plugin architecture for community modules | Defined interface for jurisdiction- or industry-specific community modules | ✅ |
|
|
83
|
+
|
|
84
|
+
## Scope
|
|
85
|
+
|
|
86
|
+
**Explicitly out of scope, and why:**
|
|
87
|
+
|
|
88
|
+
- **Prohibited-practice determination (Title II)** — legal judgment call, not a runtime check
|
|
89
|
+
- **Conformity assessment / CE marking itself** — requires formal procedures, sometimes a notified body; the toolkit preps evidence, it doesn't perform the assessment
|
|
90
|
+
- **Quality management system (Art. 17)** — an organizational process, not code
|
|
91
|
+
- **GPAI systemic-risk evaluation (Art. 55)** — applies to frontier model providers, not agent builders
|
|
92
|
+
- **Actual legal filing/registration submission** — data prep is automated, submission is not
|
|
93
|
+
|
|
94
|
+
## Contributing
|
|
95
|
+
|
|
96
|
+
Contributions are welcome, especially jurisdiction- or industry-specific modules. Open an issue to discuss before submitting a large PR.
|
|
97
|
+
|
|
98
|
+
**Writing a plugin:** implement `aiactguard.plugins.Plugin` — a `name`, a `description`, and a `generate(logger, *, questionnaire=None, **kwargs) -> str` method (the same shape every built-in report/mapping already has). See [examples/plugins/example_gxp_plugin.py](examples/plugins/example_gxp_plugin.py) for a worked example. To publish one for others to auto-discover, register it under the `aiactguard.plugins` entry-point group in your own package's `pyproject.toml`:
|
|
99
|
+
|
|
100
|
+
```toml
|
|
101
|
+
[project.entry-points."aiactguard.plugins"]
|
|
102
|
+
gxp = "aiactguard_gxp_plugin:plugin"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Callers pick it up with `aiactguard.plugins.discover_entry_points()`.
|
|
106
|
+
|
|
107
|
+
## License
|
|
108
|
+
|
|
109
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# AIActGuard — Compliance & Governance Middleware for Agentic AI
|
|
2
|
+
|
|
3
|
+
**Working tagline:** *"Drop-in EU AI Act compliance for any agent framework — audit trails, risk classification, and human-approval gates in one decorator."*
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Why this, why now
|
|
8
|
+
|
|
9
|
+
- The EU AI Act's obligations for high-risk AI systems became fully enforceable on **August 2, 2026** — three days before this doc was written. Every enterprise running agentic AI in HR, healthcare, finance, critical infrastructure, or (like GSK) pharma supply chain now has a live legal obligation and almost no open-source tooling to meet it.
|
|
10
|
+
- The agentic AI GitHub landscape is saturated at the orchestration layer (LangChain, CrewAI, AutoGen, Dify, Langflow all have 50k–150k+ stars). Nobody has claimed the **governance/compliance layer** that sits *alongside* those frameworks.
|
|
11
|
+
- "Picks and shovels" repos that solve a boring, urgent, universally-needed problem (not a flashy demo) have a track record of steady, durable star growth rather than one viral spike that fades.
|
|
12
|
+
- This is also the most credible repo for your career narrative: Principal AI Architect at a regulated pharma enterprise, shipping the compliance tooling the whole industry now needs. It's a stronger signal to a VP/Head of AI hiring panel than a generic agent framework would be.
|
|
13
|
+
|
|
14
|
+
## 2. What it is (and isn't)
|
|
15
|
+
|
|
16
|
+
**Is:** A lightweight middleware/wrapper layer that any existing agent stack can adopt without ripping out its framework.
|
|
17
|
+
|
|
18
|
+
**Isn't:** Another agent orchestrator. You are not competing with LangChain/CrewAI — you're making them compliant.
|
|
19
|
+
|
|
20
|
+
## 3. Full module coverage (expanded scope)
|
|
21
|
+
|
|
22
|
+
Each module is scoped honestly: it logs, drafts, tests, or flags something concrete — none of them claim to *certify* compliance on their own, since that's a legal determination. That honesty is what makes a broad feature set credible instead of overreaching.
|
|
23
|
+
|
|
24
|
+
### Core (Phase 1)
|
|
25
|
+
|
|
26
|
+
| # | Module | Article(s) | What it does |
|
|
27
|
+
|---|---|---|---|
|
|
28
|
+
| 1 | **Risk classification engine** | Art. 6, Annex III | Tags each agent action/tool call against EU AI Act risk tiers (minimal / limited / high / unacceptable) using a configurable taxonomy across all eight Annex III high-risk categories (biometrics, critical infrastructure, education, employment, essential services, law enforcement, migration, justice/democracy) |
|
|
29
|
+
| 2 | **Immutable audit trail** | Art. 12 | Every decision, tool call, input/output, model version, and timestamp logged to an append-only store |
|
|
30
|
+
| 3 | **Human-in-the-loop approval gates** | Art. 14 | Configurable interrupt points that pause execution before a high-risk action fires, routing to a human approver, with escalation and override logging |
|
|
31
|
+
| 4 | **Explainability capture** | Art. 13 | Structures the agent's chain-of-thought/tool-selection rationale into an auditor-readable format |
|
|
32
|
+
| 5 | **Framework adapters** | — | LangChain, LangGraph, CrewAI, AutoGen, OpenAI Agents SDK, Claude Agent SDK |
|
|
33
|
+
| 6 | **Policy-as-code** | — | YAML rules defining what counts as high-risk for a given org and what triggers a human gate |
|
|
34
|
+
|
|
35
|
+
### Documentation & assessment tooling (Phase 2)
|
|
36
|
+
|
|
37
|
+
| # | Module | Article(s) | What it does |
|
|
38
|
+
|---|---|---|---|
|
|
39
|
+
| 7 | **Technical documentation generator** | Art. 11, Annex IV | Auto-drafts the Annex IV technical file (system description, design choices, data used, performance metrics) from audit logs + a guided questionnaire for the parts code can't infer |
|
|
40
|
+
| 8 | **Conformity readiness checklist** | Art. 43 | A gap-analysis tool that checks your logged evidence against each Annex IV/VI requirement and flags what's missing — a pre-assessment aid, not the assessment itself |
|
|
41
|
+
| 9 | **Fundamental Rights Impact Assessment (FRIA) template generator** | Art. 27 | Pre-fills an FRIA draft from your system's risk classification and deployment context — required for deployers in banking, insurance, and public-service high-risk use cases |
|
|
42
|
+
| 10 | **Post-market monitoring plan generator** | Art. 72 | Produces a monitoring plan template scaffolded from the system's risk tier and logged incident categories |
|
|
43
|
+
| 11 | **EU database registration data prep** | Art. 71 | Auto-compiles the information fields the Art. 71 registration form requires from your system's metadata — the actual filing stays manual, but the tedious data-gathering is automated |
|
|
44
|
+
|
|
45
|
+
### Robustness & incident tooling (Phase 3)
|
|
46
|
+
|
|
47
|
+
| # | Module | Article(s) | What it does |
|
|
48
|
+
|---|---|---|---|
|
|
49
|
+
| 12 | **Adversarial/red-team test harness** | Art. 15 | Runs a library of prompt-injection, jailbreak, and edge-case scenarios against your agent and reports pass/fail with logs |
|
|
50
|
+
| 13 | **Bias & fairness scan** | Art. 10 | Statistical checks on agent decisions across protected-characteristic proxies in the input data it processes at runtime (not training-data governance, which is out of scope) |
|
|
51
|
+
| 14 | **Serious incident report drafter** | Art. 73 | Turns a flagged incident (a gate override, an anomalous action, a user-reported harm) into a structured draft matching the incident-report format, for human review before filing |
|
|
52
|
+
| 15 | **GPAI transparency card generator** | Art. 53 | For teams building on top of general-purpose models, auto-generates a model transparency summary (capabilities, limitations, known risks) from config + your usage patterns |
|
|
53
|
+
|
|
54
|
+
### Multi-agent & multi-standard extensions (Phase 4 — differentiators)
|
|
55
|
+
|
|
56
|
+
| # | Module | What it does |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| 16 | **Composite-system risk aggregation** | A genuinely novel piece: flags when multiple individually low-risk agents, composed into a pipeline, cross into high-risk territory as a system — something no existing tool checks for, and a natural fit for your RL/systems background |
|
|
59
|
+
| 17 | **NIST AI RMF mapping layer** | Maps the same audit/risk data to NIST AI RMF's Govern/Map/Measure/Manage functions — widens the addressable market to US enterprises without EU exposure |
|
|
60
|
+
| 18 | **ISO/IEC 42001 mapping layer** | Same data, mapped to ISO 42001 AI management system clauses — relevant for any org pursuing certification |
|
|
61
|
+
| 19 | **Plugin architecture for community modules** | A defined interface so the community can contribute jurisdiction-specific or industry-specific modules (e.g., a pharma/GxP module, a financial services module) over time — this is also a strong organic-growth mechanism: contributors who add a module have a reason to promote the repo themselves |
|
|
62
|
+
|
|
63
|
+
### What stays explicitly out of scope (and why)
|
|
64
|
+
|
|
65
|
+
- **Prohibited-practice determination (Title II)** — legal judgment call, not a runtime check
|
|
66
|
+
- **Conformity assessment / CE marking itself** — requires formal procedures, sometimes a notified body; the toolkit preps evidence, it doesn't perform the assessment
|
|
67
|
+
- **Quality management system (Art. 17)** — an organizational process, not code
|
|
68
|
+
- **GPAI systemic-risk evaluation (Art. 55)** — applies to frontier model providers, not agent builders
|
|
69
|
+
- **Actual legal filing/registration submission** — data prep is automated, submission is not
|
|
70
|
+
|
|
71
|
+
This boundary list should live prominently in the README — it's what makes the broad feature set credible rather than overreaching.
|
|
72
|
+
|
|
73
|
+
## 4. Architecture (high level)
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
Your existing agent (LangChain / CrewAI / etc.)
|
|
77
|
+
│
|
|
78
|
+
@aiactguard.watch ← decorator/callback, no framework replacement
|
|
79
|
+
│
|
|
80
|
+
┌────────┴─────────┐
|
|
81
|
+
│ AIActGuard Core │
|
|
82
|
+
│ - Risk classifier │
|
|
83
|
+
│ - Policy engine │
|
|
84
|
+
│ - Audit logger │
|
|
85
|
+
└────────┬─────────┘
|
|
86
|
+
│
|
|
87
|
+
Audit store (SQLite default, Postgres for prod)
|
|
88
|
+
│
|
|
89
|
+
Report generator ──► compliance-report.md / .pdf
|
|
90
|
+
Dashboard (optional, Streamlit) ──► live view of gated/logged actions
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## 5. Realistic build roadmap (part-time, alongside a full-time role)
|
|
94
|
+
|
|
95
|
+
The full 19-module scope above is the destination, not the launch state — launching with real depth in Phase 1 and a visible, documented roadmap for Phases 2–4 is what actually drives sustained stars (people star ambitious, clearly-planned projects and come back for releases; they don't star a repo that ships everything half-finished on day one).
|
|
96
|
+
|
|
97
|
+
- **Weeks 1–2 — Phase 1 core:** Risk classifier + audit logger + LangChain adapter + policy-as-code
|
|
98
|
+
- **Weeks 3–4 — Phase 1 complete:** Human-approval gates + explainability capture + CrewAI and Claude Agent SDK adapters
|
|
99
|
+
- **Week 5 — Launch prep:** Docs site, quickstart per framework, README with the full module roadmap visible (this is your public commitment device and your changelog-driven visibility engine)
|
|
100
|
+
- **Week 6 — Launch**
|
|
101
|
+
- **Weeks 7–10 — Phase 2:** Technical documentation generator, conformity readiness checklist, FRIA generator
|
|
102
|
+
- **Weeks 11–14 — Phase 3:** Red-team harness, bias scan, incident report drafter, GPAI transparency card
|
|
103
|
+
- **Ongoing — Phase 4:** Composite-risk aggregation (your strongest technical differentiator — worth prioritizing earlier if you want a research-flavored angle sooner), NIST/ISO mapping layers, plugin architecture opened to contributors
|
|
104
|
+
|
|
105
|
+
Each phase completion is a natural release/announcement moment — this turns one launch into 4–5 visibility events instead of one.
|
|
106
|
+
|
|
107
|
+
## 6. Visibility / star-growth plan (this is where most repos fail, not the code)
|
|
108
|
+
|
|
109
|
+
- **Timed launch** explicitly anchored to the EU AI Act enforcement date — "the compliance gap every agent team now has."
|
|
110
|
+
- **Show HN**, r/MachineLearning, r/LocalLLaMA, and LinkedIn — post from your own account leveraging your GSK/pharma + PhD credibility, not an anonymous repo drop.
|
|
111
|
+
- **Submit to the existing "awesome-agentic-ai" curated lists** as a PR — free distribution into an audience that's already primed.
|
|
112
|
+
- **One technical blog post**: "Why agentic AI needs compliance-by-design under the EU AI Act" — this slots directly into the thought-leadership work you already have in motion (the pharma supply-chain resilience piece and the JEPA/bandit piece).
|
|
113
|
+
- **Framework-specific quickstarts** as separate short posts/gists ("Add EU AI Act compliance to your LangChain agent in 5 minutes") — lowers adoption friction and gives you multiple distinct pieces of shareable content from one project.
|
|
114
|
+
- **A "compliance-checked" badge** projects can add to their own README once integrated — this is a viral distribution loop, similar to how CI/coverage badges spread.
|
|
115
|
+
- Target compliance/legal-tech communities in addition to ML ones — this is a rare repo with two distinct audiences, which doubles your reach.
|
|
116
|
+
|
|
117
|
+
## 7. Name — confirmed: AIActGuard
|
|
118
|
+
|
|
119
|
+
Literal and high-intent for SEO ("EU AI Act" + "compliance"/"agent"), and it reads clearly as a governance layer rather than another orchestration framework.
|
|
120
|
+
|
|
121
|
+
## 8. License
|
|
122
|
+
|
|
123
|
+
**MIT.** Best fit here — max adoption, no copyleft friction for enterprises evaluating it (the exact audience you're targeting), and it's the norm across nearly all the comparable repos referenced earlier (LangChain, CrewAI, Guardrails AI).
|
|
124
|
+
|
|
125
|
+
## 9. Claude Code kickoff prompt
|
|
126
|
+
|
|
127
|
+
Since you'll build this in Claude Code, here's a ready-to-paste prompt to start the Phase 1 scaffold. Drop this plan file into the project directory first so Claude Code has the full spec as context.
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
I'm building AIActGuard, an MIT-licensed Python library that adds EU AI Act
|
|
131
|
+
technical-obligation tooling (audit logging, risk classification, human
|
|
132
|
+
approval gates) as middleware around existing agent frameworks — not a new
|
|
133
|
+
orchestrator. Full spec is in agentguard-project-plan.md in this directory.
|
|
134
|
+
|
|
135
|
+
Scaffold the Phase 1 MVP:
|
|
136
|
+
1. Package structure: aiactguard/ with core/, adapters/, policy/, storage/
|
|
137
|
+
2. core/risk_classifier.py — classifies actions against a configurable
|
|
138
|
+
Annex III risk taxonomy (YAML-driven, ship a default taxonomy file)
|
|
139
|
+
3. core/audit_logger.py — append-only audit log, SQLite backend by default,
|
|
140
|
+
schema covering timestamp, action, inputs/outputs, model version, risk tier
|
|
141
|
+
4. adapters/langchain_adapter.py — a callback/decorator that wraps a
|
|
142
|
+
LangChain agent's tool calls and routes them through the risk classifier
|
|
143
|
+
and audit logger with minimal integration code required
|
|
144
|
+
5. policy/schema.py + a default policy.yaml — defines what triggers a
|
|
145
|
+
human-approval gate per org config
|
|
146
|
+
6. A working example in examples/langchain_quickstart.py showing a full
|
|
147
|
+
wrapped agent in under 20 lines
|
|
148
|
+
7. pyproject.toml, MIT LICENSE file, and a README.md skeleton (I'll refine
|
|
149
|
+
the README content separately, but scaffold the standard sections:
|
|
150
|
+
badges, install, quickstart, module roadmap table, contributing, license)
|
|
151
|
+
8. Basic test coverage for risk_classifier and audit_logger
|
|
152
|
+
|
|
153
|
+
Keep it dependency-light — no framework lock-in beyond what's needed for
|
|
154
|
+
the LangChain adapter itself. Ask me before adding any new dependency
|
|
155
|
+
beyond langchain, pyyaml, and pytest.
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## 10. Next steps
|
|
159
|
+
|
|
160
|
+
1. Register the GitHub repo under `AIActGuard`, MIT LICENSE
|
|
161
|
+
2. Open Claude Code in the repo directory with this plan file present, paste the kickoff prompt above
|
|
162
|
+
3. Come back here for the README launch copy, the LinkedIn/Show HN posts, and the framework-specific quickstart write-ups once Phase 1 is working code — that content lands better once there's a real repo to point at
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
from .core.audit_logger import AuditLogger
|
|
2
|
+
from .core.risk_classifier import RiskClassifier, RiskTier
|
|
3
|
+
from .core.watch import watch
|
|
4
|
+
from .policy.schema import PolicyConfig
|
|
5
|
+
|
|
6
|
+
__all__ = ["watch", "RiskClassifier", "RiskTier", "AuditLogger", "PolicyConfig"]
|
|
7
|
+
__version__ = "0.1.0"
|
|
File without changes
|