@aigis-ai/cli 2.0.1 → 2.1.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.
- package/README.md +97 -178
- package/bin/aigis.js +139 -8
- package/content/resolvers/triggers.json +363 -41
- package/content/skills/areas/audit-logging.md +33 -0
- package/content/skills/areas/bias-monitoring.md +34 -0
- package/content/skills/areas/confidence-scoring.md +23 -0
- package/content/skills/areas/data-integrity.md +25 -0
- package/content/skills/areas/eu-ai-act-art-13-deployer-transparency.md +133 -0
- package/content/skills/areas/eu-ai-act-art-50-transparency-disclosure.md +134 -0
- package/content/skills/areas/eu-ai-act-art-73-incident-reporting.md +149 -0
- package/content/skills/areas/eu-ai-act-art-9-risk-management.md +141 -0
- package/content/skills/areas/fallback-patterns.md +28 -0
- package/content/skills/areas/human-oversight.md +38 -0
- package/content/skills/areas/input-validation.md +27 -0
- package/content/skills/areas/monitoring.md +29 -0
- package/content/skills/areas/prompt-security.md +29 -0
- package/content/templates/eu-ai-act-annex-iv.md +193 -0
- package/docs/frontmatter-schema.md +75 -0
- package/docs/screenshots/README.md +17 -0
- package/docs/screenshots/agent-flow.png +0 -0
- package/docs/screenshots/setup.png +0 -0
- package/docs/screenshots/verify.png +0 -0
- package/lib/auto-verify.js +70 -1
- package/lib/build.js +101 -12
- package/lib/classify.js +8 -2
- package/lib/init.js +269 -5
- package/lib/jurisdiction.js +137 -0
- package/lib/report.js +331 -0
- package/package.json +1 -1
- package/scripts/area-controls-baseline.json +188 -0
- package/scripts/area-frontmatter.schema.json +61 -0
- package/scripts/validate-area-frontmatter.js +228 -0
- package/cli-python/LICENSE +0 -21
- package/cli-python/README.md +0 -32
- package/cli-python/aigis_cli/SKILL.md +0 -70
- package/cli-python/aigis_cli/__init__.py +0 -3
- package/cli-python/aigis_cli/__pycache__/__init__.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/annotate.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/build.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/checksum.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/classify.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/cli.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/fetch.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/init_ide.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/keywords.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/search.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/annotate.py +0 -45
- package/cli-python/aigis_cli/auto_verify.py +0 -518
- package/cli-python/aigis_cli/build.py +0 -470
- package/cli-python/aigis_cli/checksum.py +0 -22
- package/cli-python/aigis_cli/classify.py +0 -192
- package/cli-python/aigis_cli/cli.py +0 -618
- package/cli-python/aigis_cli/content/index/audit-scan.md +0 -217
- package/cli-python/aigis_cli/content/index/auto-verify-rules.json +0 -439
- package/cli-python/aigis_cli/content/index/context-rules.json +0 -90
- package/cli-python/aigis_cli/content/index/frameworks.md +0 -82
- package/cli-python/aigis_cli/content/index/guardrails.json +0 -23
- package/cli-python/aigis_cli/content/index/taxonomy.md +0 -81
- package/cli-python/aigis_cli/content/resolvers/triggers.json +0 -229
- package/cli-python/aigis_cli/content/skills/areas/audit-logging.md +0 -176
- package/cli-python/aigis_cli/content/skills/areas/bias-monitoring.md +0 -172
- package/cli-python/aigis_cli/content/skills/areas/confidence-scoring.md +0 -180
- package/cli-python/aigis_cli/content/skills/areas/data-integrity.md +0 -257
- package/cli-python/aigis_cli/content/skills/areas/explainability.md +0 -174
- package/cli-python/aigis_cli/content/skills/areas/fallback-patterns.md +0 -200
- package/cli-python/aigis_cli/content/skills/areas/human-oversight.md +0 -220
- package/cli-python/aigis_cli/content/skills/areas/input-validation.md +0 -380
- package/cli-python/aigis_cli/content/skills/areas/monitoring.md +0 -207
- package/cli-python/aigis_cli/content/skills/areas/output-sanitization.md +0 -183
- package/cli-python/aigis_cli/content/skills/areas/pii-handling.md +0 -189
- package/cli-python/aigis_cli/content/skills/areas/prompt-security.md +0 -153
- package/cli-python/aigis_cli/content/skills/areas/rag-security.md +0 -230
- package/cli-python/aigis_cli/content/skills/areas/rate-limiting.md +0 -246
- package/cli-python/aigis_cli/content/skills/areas/supply-chain.md +0 -193
- package/cli-python/aigis_cli/content/skills/core.md +0 -62
- package/cli-python/aigis_cli/content/skills/infrastructure/logging.md +0 -202
- package/cli-python/aigis_cli/content/skills/infrastructure/rate-limiting.md +0 -169
- package/cli-python/aigis_cli/content/skills/infrastructure/secrets.md +0 -167
- package/cli-python/aigis_cli/content/skills/workflows/fastapi-llm.md +0 -86
- package/cli-python/aigis_cli/content/templates/ai-impact-assessment.md +0 -54
- package/cli-python/aigis_cli/content/templates/intended-purpose-doc.md +0 -39
- package/cli-python/aigis_cli/content/templates/risk-characterization.md +0 -34
- package/cli-python/aigis_cli/content/templates/third-party-assessment.md +0 -41
- package/cli-python/aigis_cli/content/verify/checklist-audit-logging.md +0 -13
- package/cli-python/aigis_cli/content/verify/checklist-bias-monitoring.md +0 -13
- package/cli-python/aigis_cli/content/verify/checklist-confidence-scoring.md +0 -13
- package/cli-python/aigis_cli/content/verify/checklist-data-integrity.md +0 -12
- package/cli-python/aigis_cli/content/verify/checklist-explainability.md +0 -13
- package/cli-python/aigis_cli/content/verify/checklist-fallback-patterns.md +0 -13
- package/cli-python/aigis_cli/content/verify/checklist-human-oversight.md +0 -14
- package/cli-python/aigis_cli/content/verify/checklist-input-validation.md +0 -16
- package/cli-python/aigis_cli/content/verify/checklist-monitoring.md +0 -13
- package/cli-python/aigis_cli/content/verify/checklist-output-sanitization.md +0 -14
- package/cli-python/aigis_cli/content/verify/checklist-pii-handling.md +0 -14
- package/cli-python/aigis_cli/content/verify/checklist-prompt-security.md +0 -13
- package/cli-python/aigis_cli/content/verify/checklist-rag-security.md +0 -12
- package/cli-python/aigis_cli/content/verify/checklist-rate-limiting.md +0 -13
- package/cli-python/aigis_cli/content/verify/checklist-supply-chain.md +0 -13
- package/cli-python/aigis_cli/fetch.py +0 -232
- package/cli-python/aigis_cli/init_ide.py +0 -159
- package/cli-python/aigis_cli/keywords.py +0 -73
- package/cli-python/aigis_cli/search.py +0 -69
- package/cli-python/aigis_cli.egg-info/PKG-INFO +0 -59
- package/cli-python/aigis_cli.egg-info/SOURCES.txt +0 -56
- package/cli-python/aigis_cli.egg-info/dependency_links.txt +0 -1
- package/cli-python/aigis_cli.egg-info/entry_points.txt +0 -2
- package/cli-python/aigis_cli.egg-info/requires.txt +0 -6
- package/cli-python/aigis_cli.egg-info/top_level.txt +0 -1
- package/cli-python/dist/aigis_cli-1.0.3-py3-none-any.whl +0 -0
- package/cli-python/dist/aigis_cli-1.0.3.tar.gz +0 -0
- package/cli-python/pyproject.toml +0 -49
package/README.md
CHANGED
|
@@ -1,236 +1,155 @@
|
|
|
1
1
|
# Aigis
|
|
2
2
|
|
|
3
|
-
AI governance
|
|
3
|
+
**AI governance that ships with your code.**
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
[](https://www.npmjs.com/package/@aigis-ai/cli)
|
|
7
|
-
[](https://pypi.org/project/aigis-cli/)
|
|
8
|
-
[](https://nodejs.org)
|
|
9
|
-
[](https://www.python.org/)
|
|
5
|
+
Aigis sits between you and your coding agent (Cursor, Claude Code, GitHub Copilot, Windsurf) and gives the agent curated AI governance patterns mapped to NIST AI RMF, OWASP Top 10 for LLMs, ISO/IEC 42001, and the EU AI Act.
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
You don't run Aigis. Your agent does. After one setup command, you describe what you're building and your agent picks the right governance patterns, implements them, and verifies the result — all in the same chat where you write code.
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## What Aigis does
|
|
16
|
-
|
|
17
|
-
Aigis gives your coding agent curated governance patterns it can fetch via a simple CLI. The agent reads the patterns, applies them when writing code, and verifies its own output against checklists — all mapped to real framework control IDs.
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
Without Aigis With Aigis
|
|
21
|
-
─────────────────── ─────────────────
|
|
22
|
-
Agent writes LLM code Agent classifies the system
|
|
23
|
-
No input validation Fetches governance patterns
|
|
24
|
-
No PII redaction Writes code with controls built in
|
|
25
|
-
No audit logging Self-verifies against checklists
|
|
26
|
-
Compliance team finds gaps later Compliance documentation generated alongside code
|
|
27
|
-
Rework cycle Ships compliant on first pass
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Quick start
|
|
31
|
-
|
|
32
|
-
Install the CLI with **npm** (JavaScript / Node.js) or **pip** (Python). Both packages expose the same `aigis` command and behavior.
|
|
33
|
-
|
|
34
|
-
**JavaScript developers — npm**
|
|
9
|
+
## Install
|
|
35
10
|
|
|
36
11
|
```bash
|
|
37
12
|
npm install -g @aigis-ai/cli
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
**Python developers — pip**
|
|
41
|
-
|
|
42
|
-
```bash
|
|
13
|
+
# or
|
|
43
14
|
pip install aigis-cli
|
|
44
|
-
```
|
|
45
15
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
# Set up for your IDE
|
|
50
|
-
aigis init cursor # or: claude-code, windsurf, copilot
|
|
51
|
-
|
|
52
|
-
# Classify your system
|
|
53
|
-
aigis classify --traits uses-llm,accepts-user-input,processes-pii,is-external
|
|
16
|
+
cd your-project
|
|
17
|
+
aigis init cursor # or: claude-code, copilot, windsurf
|
|
18
|
+
```
|
|
54
19
|
|
|
55
|
-
|
|
56
|
-
aigis get input-validation pii-handling audit-logging
|
|
20
|
+
That's it. `aigis init` writes a single rules file (`.cursorrules` for Cursor, `.github/copilot-instructions.md` for Copilot, etc.) that teaches your agent the Aigis workflow. Your agent reads it on every interaction in this project.
|
|
57
21
|
|
|
58
|
-
|
|
59
|
-
aigis verify input-validation pii-handling audit-logging
|
|
22
|
+

|
|
60
23
|
|
|
61
|
-
|
|
62
|
-
aigis template ai-impact-assessment intended-purpose-doc
|
|
63
|
-
```
|
|
24
|
+
## Quick start
|
|
64
25
|
|
|
65
|
-
|
|
26
|
+
Open the project in your IDE. In the agent chat, just describe what you're building:
|
|
66
27
|
|
|
67
|
-
|
|
28
|
+
> *Build me an EU AI Act compliant customer support chatbot for an e-commerce site. Use aigis to figure out the governance patterns and apply them.*
|
|
68
29
|
|
|
69
|
-
|
|
30
|
+
Your agent will read `.cursorrules`, classify the description against the resolver, fetch the relevant procedures, and implement them — invoking `aigis` itself as it works:
|
|
70
31
|
|
|
71
|
-
|
|
32
|
+

|
|
72
33
|
|
|
73
|
-
|
|
34
|
+
When the agent is done, you can verify deterministically:
|
|
74
35
|
|
|
75
|
-
|
|
36
|
+
```bash
|
|
37
|
+
aigis verify input-validation --auto . --jurisdiction eu
|
|
38
|
+
```
|
|
76
39
|
|
|
77
|
-
|
|
78
|
-
|---------|---------|
|
|
79
|
-
| `aigis classify --traits <list>` | Classify system, get risk tier and recommended files |
|
|
80
|
-
| `aigis classify "<description>"` | Same, using natural language (keyword matching) |
|
|
81
|
-
| `aigis get <id> [id...]` | Fetch implementation pattern files |
|
|
82
|
-
| `aigis get <id> --lang py\|js` | Fetch filtered to one language |
|
|
83
|
-
| `aigis verify <id> [id...]` | Fetch verification checklists |
|
|
84
|
-
| `aigis template <id> [id...]` | Fetch compliance documentation templates |
|
|
85
|
-
| `aigis audit --scan` | Get structured prompt for auditing existing codebases |
|
|
86
|
-
| `aigis audit --traits <list>` | Run full audit (classify + all checklists bundled) |
|
|
87
|
-
| `aigis search <query>` | Search content by keyword or control ID |
|
|
88
|
-
| `aigis search --list` | List all available files |
|
|
89
|
-
| `aigis annotate <id> "<note>"` | Attach a local note for future sessions |
|
|
90
|
-
| `aigis init <ide>` | Set up for cursor, claude-code, windsurf, or copilot |
|
|
91
|
-
| `aigis traits` | List all 22 classification traits |
|
|
40
|
+

|
|
92
41
|
|
|
93
|
-
|
|
42
|
+
The whole loop — describe, implement, verify — happens without leaving the IDE. You stay in the chat; the agent uses the CLI.
|
|
94
43
|
|
|
95
|
-
|
|
44
|
+
## What `aigis init` actually did
|
|
96
45
|
|
|
97
|
-
|
|
46
|
+
When you ran `aigis init cursor`, three things landed in your repo:
|
|
98
47
|
|
|
99
|
-
|
|
48
|
+
1. **`.cursorrules`** — the Aigis "core skill" your agent loads on every interaction. It documents the workflow (`classify → build → implement → verify → report`) and embeds a 39-phrase resolver block (high-confidence and low-confidence triggers) the agent uses to pick traits from your description.
|
|
49
|
+
2. **A checksum** at the top of the resolver block. When Aigis updates, `aigis init <ide> --refresh` overwrites cleanly; mismatched checksums error out so you can see what changed.
|
|
50
|
+
3. **No hidden services. No telemetry. No background processes.** Just a markdown file your agent reads.
|
|
100
51
|
|
|
101
|
-
|
|
52
|
+
Optional add-ons at init time:
|
|
102
53
|
|
|
103
|
-
|
|
54
|
+
```bash
|
|
55
|
+
aigis init cursor --ci github # drops .github/workflows/aigis.yml
|
|
56
|
+
aigis init cursor --hook # installs .git/hooks/pre-commit
|
|
57
|
+
```
|
|
104
58
|
|
|
105
|
-
|
|
59
|
+
Both surfaces read a single `.aigisrc.json` config:
|
|
106
60
|
|
|
107
|
-
|
|
61
|
+
```json
|
|
62
|
+
{ "areas": ["pii-handling", "audit-logging"], "jurisdiction": "eu" }
|
|
63
|
+
```
|
|
108
64
|
|
|
109
|
-
|
|
110
|
-
|------|-------|----------------|
|
|
111
|
-
| input-validation | LLM01 | Sanitization, length limits, prompt separation, schema enforcement, injection detection |
|
|
112
|
-
| output-sanitization | LLM05 | HTML encoding, parameterized queries, code sandboxing, content type validation |
|
|
113
|
-
| pii-handling | LLM02 | PII detection/redaction, data minimization, output filtering, separated storage |
|
|
114
|
-
| prompt-security | LLM07 | No secrets in prompts, minimal prompts, leakage detection, server-side enforcement |
|
|
115
|
-
| human-oversight | LLM06 | Tool allowlists, approval gates, action rate limiting, override mechanisms |
|
|
116
|
-
| supply-chain | LLM03 | Model version pinning, regression testing, fallback providers, version tracking |
|
|
117
|
-
| data-integrity | LLM04 | Data provenance, RAG validation, checksums, distribution monitoring, batch rollback |
|
|
118
|
-
| rag-security | LLM08 | Vector DB access control, tenant isolation, context validation, permission inheritance |
|
|
119
|
-
| confidence-scoring | LLM09 | Confidence metadata, grounding verification, recommendation framing |
|
|
120
|
-
| rate-limiting | LLM10 | Per-user limits, token budgets, cost monitoring, request timeouts |
|
|
121
|
-
| audit-logging | — | Structured entries, trace ID propagation, decision records |
|
|
122
|
-
| bias-monitoring | — | Fairness metadata, distribution monitoring, periodic reports |
|
|
123
|
-
| fallback-patterns | — | Default safe responses, circuit breakers, kill switches |
|
|
124
|
-
| monitoring | — | Key metrics, drift detection, user feedback, incident logging |
|
|
125
|
-
| explainability | — | Decision explanations, model cards, audit-friendly records |
|
|
65
|
+
The CI workflow runs `aigis verify` on every PR; the pre-commit hook runs it before each commit. Configure once, both run.
|
|
126
66
|
|
|
127
|
-
##
|
|
67
|
+
## What's new in v2.1
|
|
128
68
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
69
|
+
- **EU AI Act mapping** — Articles 9, 10, 12, 13, 14, 15, 50, 72, 73 mapped to runnable governance patterns, plus an Annex IV technical documentation template
|
|
70
|
+
- **`--jurisdiction` flag** (`eu`, `us-regulated`) — gates content by where you ship. EU AI Act citations only surface when you're shipping to EU users
|
|
71
|
+
- **`aigis report`** — generates audit-ready compliance documentation with cross-framework citations (NIST + OWASP + ISO + EU AI Act) and file:line evidence per check
|
|
72
|
+
- **Activation surfaces** — `aigis init --ci github` drops a GitHub Action; `aigis init --hook` installs a pre-commit hook
|
|
73
|
+
- **`--tight` flag** (experimental) — minimal briefs for users who want less context. Requires ≥2 trait matches per area instead of ≥1
|
|
74
|
+
- **Resolver expansion** — 27 new triggers covering modern AI project types (internal coding assistants, agentic code review, document Q&A, image generation, enterprise search) and EU Annex III high-risk categories (biometric ID, credit scoring, hiring, law enforcement)
|
|
135
75
|
|
|
136
|
-
##
|
|
76
|
+
## The principle behind Aigis
|
|
137
77
|
|
|
138
|
-
|
|
78
|
+
Governance isn't a content problem. It's an interface problem.
|
|
139
79
|
|
|
140
|
-
|
|
141
|
-
# Get the structured scan prompt
|
|
142
|
-
aigis audit --scan
|
|
80
|
+
NIST AI RMF, OWASP Top 10 for LLMs, ISO/IEC 42001, and the EU AI Act are all rigorous, all published, and all sit in documents that engineering teams never read. Aigis treats governance as an **agent-computer interface** problem: how the right content reaches an LM agent at the right time, in the right shape.
|
|
143
81
|
|
|
144
|
-
|
|
145
|
-
|
|
82
|
+
- Context layered for on-demand loading (core skill always loaded; per-area procedures fetched when needed)
|
|
83
|
+
- Deterministic rules where accuracy isn't negotiable (resolver triggers, brief generation, verify regexes)
|
|
84
|
+
- Flexible reasoning where real projects don't fit rigid templates (the brief tells the agent to skip areas that don't apply, with a written reason)
|
|
146
85
|
|
|
147
|
-
|
|
148
|
-
# Agent evaluates existing code against each check → gap report
|
|
149
|
-
```
|
|
86
|
+
Inspired by [SWE-agent's work on agent-computer interfaces](https://arxiv.org/abs/2405.15793) — the idea that *how* information reaches an LM agent matters as much as *what* reaches it.
|
|
150
87
|
|
|
151
|
-
##
|
|
88
|
+
## Manual CLI reference (for CI, scripting, audit prep, power users)
|
|
152
89
|
|
|
153
|
-
Aigis
|
|
90
|
+
The CLI exists in case you want to drive Aigis directly — for CI workflows, audit prep, debugging, or one-off invocations.
|
|
154
91
|
|
|
155
92
|
```bash
|
|
156
|
-
#
|
|
157
|
-
aigis
|
|
158
|
-
|
|
159
|
-
#
|
|
160
|
-
aigis
|
|
161
|
-
|
|
93
|
+
# Classification + brief
|
|
94
|
+
aigis classify "<description>" # detect traits + recommended areas
|
|
95
|
+
aigis build "<description>" # the consolidated brief (the main command)
|
|
96
|
+
aigis build "..." --jurisdiction eu # surface EU AI Act content for EU-bound systems
|
|
97
|
+
aigis build "..." --tight # minimal brief: ≥2 trait matches required (experimental)
|
|
98
|
+
aigis build "..." --list # area names + traits, no procedure content
|
|
99
|
+
aigis build "..." --compact # pointer-only brief
|
|
100
|
+
|
|
101
|
+
# Per-area work
|
|
102
|
+
aigis get <area> # fetch a single governance procedure
|
|
103
|
+
aigis infra <area> # fetch infrastructure pattern (rate-limiting, secrets, logging)
|
|
104
|
+
aigis workflow <type> # fetch workflow template
|
|
105
|
+
|
|
106
|
+
# Verify + audit
|
|
107
|
+
aigis verify <area> --auto . # deterministic check on your implementation
|
|
108
|
+
aigis verify <area> --auto . --jurisdiction eu # surfaces EU AI Act citations in output
|
|
109
|
+
aigis report --from-classify "<desc>" --jurisdiction eu --output audit.md
|
|
110
|
+
# audit-ready compliance documentation
|
|
111
|
+
aigis audit --scan # discovery prompt for auditing existing code
|
|
112
|
+
aigis audit --traits <list> # scoped audit with deterministic denominator
|
|
113
|
+
|
|
114
|
+
# Misc
|
|
115
|
+
aigis search --list # list all available areas
|
|
116
|
+
aigis traits # list classification traits
|
|
117
|
+
aigis template <id> # compliance documentation template
|
|
162
118
|
```
|
|
163
119
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
Aigis works with any coding agent that can execute shell commands:
|
|
167
|
-
|
|
168
|
-
- **Cursor** — `aigis init cursor` writes `.cursorrules`
|
|
169
|
-
- **Claude Code** — `aigis init claude-code` creates `~/.claude/skills/aigis/SKILL.md`
|
|
170
|
-
- **Windsurf** — `aigis init windsurf` writes `.windsurfrules`
|
|
171
|
-
- **GitHub Copilot** — `aigis init copilot` writes `.github/copilot-instructions.md`
|
|
172
|
-
- **Any agent** — if it can run a terminal command and read stdout, it works
|
|
120
|
+
Run `aigis --help` for full options.
|
|
173
121
|
|
|
174
|
-
##
|
|
122
|
+
## Honest about what this isn't
|
|
175
123
|
|
|
176
|
-
|
|
124
|
+
- **Not a certification.** EU AI Act conformity assessment requires a notified body. `aigis report` is preparation material; it does not certify.
|
|
125
|
+
- **Not a security audit.** `aigis verify` is heuristic regex over your source. It catches common misimplementations; it doesn't replace SAST, code review, or penetration testing.
|
|
126
|
+
- **Doesn't run your code or call your APIs.** The agent does the work. Aigis provides the brief, the verifier, and the audit doc.
|
|
127
|
+
- **Local. No cloud. No telemetry.** Aigis ships nothing back to a server. Your descriptions, your code, and your verify results stay on your machine.
|
|
177
128
|
|
|
178
|
-
|
|
179
|
-
- **NIST AI Risk Management Framework (AI RMF 1.0)** — 25 subcategories mapped
|
|
180
|
-
- **ISO/IEC 42001:2023** — 15 control references mapped
|
|
129
|
+
## Benchmark results
|
|
181
130
|
|
|
182
|
-
|
|
131
|
+
v2.0 was benchmarked at every iteration. Final numbers, against the same 10 descriptions:
|
|
183
132
|
|
|
184
|
-
|
|
133
|
+
- Baseline (no Aigis): P=0.737, R=0.905, F1=0.790
|
|
134
|
+
- v2.0 (`aigis build`): P=0.847, R=0.851, F1=0.837
|
|
185
135
|
|
|
186
|
-
|
|
136
|
+
F1 beats baseline by +0.047. v2.1 ships `--tight` as a flag-gated experiment; promotion to default in v2.2 is pending a confirmation benchmark. Methodology, per-run tables, and the v2.1 manual end-to-end test live in the [`benchmarks/`](https://github.com/NayanKanaparthi/aigis) directory.
|
|
187
137
|
|
|
188
|
-
|
|
138
|
+
## Supported agents
|
|
189
139
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
│ ├── classify.js # Classification engine + guardrails
|
|
195
|
-
│ ├── fetch.js # Content reader + annotation injection
|
|
196
|
-
│ ├── keywords.js # Natural language → trait mapping
|
|
197
|
-
│ ├── search.js # Content search
|
|
198
|
-
│ ├── annotate.js # Local annotation store
|
|
199
|
-
│ └── init.js # IDE setup
|
|
200
|
-
├── content/
|
|
201
|
-
│ ├── implement/ # 15 governance pattern files
|
|
202
|
-
│ ├── verify/ # 15 verification checklists
|
|
203
|
-
│ ├── templates/ # 4 compliance doc templates
|
|
204
|
-
│ └── index/ # Taxonomy, frameworks index, guardrails, audit scan
|
|
205
|
-
├── SKILL.md # Portable agent skill file
|
|
206
|
-
└── package.json
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
**PyPI package** [`aigis-cli`](https://pypi.org/project/aigis-cli/) (Python)
|
|
210
|
-
|
|
211
|
-
```
|
|
212
|
-
cli-python/
|
|
213
|
-
├── pyproject.toml
|
|
214
|
-
└── aigis_cli/ # click + rich + python-frontmatter; mirrors the JS CLI
|
|
215
|
-
├── cli.py
|
|
216
|
-
├── classify.py, fetch.py, keywords.py, search.py, annotate.py, init_ide.py
|
|
217
|
-
├── content/ # same markdown + JSON as above (bundled as package data)
|
|
218
|
-
└── SKILL.md
|
|
219
|
-
```
|
|
140
|
+
- Cursor
|
|
141
|
+
- Claude Code
|
|
142
|
+
- GitHub Copilot
|
|
143
|
+
- Windsurf
|
|
220
144
|
|
|
221
|
-
|
|
145
|
+
Each maps to a different rules file location. `aigis init <ide>` handles the difference; `--refresh` updates safely.
|
|
222
146
|
|
|
223
147
|
## Contributing
|
|
224
148
|
|
|
225
|
-
|
|
149
|
+
Aigis is built around a curated trigger map for classification. Trigger contributions are welcome, with a one-sentence use-case justification per the template in `.github/PULL_REQUEST_TEMPLATE/trigger_mapping.md`.
|
|
226
150
|
|
|
227
|
-
|
|
228
|
-
1. Create `content/implement/your-pattern.md` following the existing format
|
|
229
|
-
2. Create `content/verify/checklist-your-pattern.md` with verification checks
|
|
230
|
-
3. Add the pattern to the trait-to-file mapping in `content/index/taxonomy.md`
|
|
231
|
-
4. Add control IDs to the YAML frontmatter
|
|
232
|
-
5. Submit a PR
|
|
151
|
+
See `CONTRIBUTING.md` for the full contributor workflow, including how to add new governance areas, workflows, infrastructure patterns, or EU AI Act article mappings.
|
|
233
152
|
|
|
234
153
|
## License
|
|
235
154
|
|
|
236
|
-
|
|
155
|
+
MIT
|
package/bin/aigis.js
CHANGED
|
@@ -5,6 +5,7 @@ const chalk = require('chalk');
|
|
|
5
5
|
const { classify } = require('../lib/classify');
|
|
6
6
|
const { get, getTemplate, getAuditScan, getWorkflow, listWorkflows, getInfra, listInfras } = require('../lib/fetch');
|
|
7
7
|
const { buildBrief, buildList, BriefTooLargeError } = require('../lib/build');
|
|
8
|
+
const { getUserJurisdictions, filterAreasByJurisdiction } = require('../lib/jurisdiction');
|
|
8
9
|
const { verify } = require('../lib/fetch');
|
|
9
10
|
const { search, listAll } = require('../lib/search');
|
|
10
11
|
const { annotate, listAnnotations, clearAnnotation } = require('../lib/annotate');
|
|
@@ -17,7 +18,7 @@ const program = new Command();
|
|
|
17
18
|
program
|
|
18
19
|
.name('aigis')
|
|
19
20
|
.description('AI governance guardrails for coding agents')
|
|
20
|
-
.version('2.
|
|
21
|
+
.version('2.1.0');
|
|
21
22
|
|
|
22
23
|
// ============================================================
|
|
23
24
|
// aigis classify
|
|
@@ -29,6 +30,7 @@ program
|
|
|
29
30
|
.option('--json', 'Output as JSON (also enabled automatically when stdout is not a TTY)')
|
|
30
31
|
.option('--confirm <ids>', 'Comma-separated low-confidence suggestion IDs to confirm (no interactive prompt)')
|
|
31
32
|
.option('--reject <ids>', 'Comma-separated low-confidence suggestion IDs to reject (no interactive prompt)')
|
|
33
|
+
.option('--jurisdiction <codes>', 'Comma-separated jurisdiction codes (eu, us-regulated, global). Adds the matching jurisdiction-* traits to your set, overriding resolver detection.')
|
|
32
34
|
.argument('[description]', 'Natural language description (resolved via content/resolvers/triggers.json)')
|
|
33
35
|
.action(async (description, opts) => {
|
|
34
36
|
// Three modes: --traits only, description only, both (additive).
|
|
@@ -72,8 +74,11 @@ program
|
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
const resolved = applyConfirmations(detection, decisions);
|
|
75
|
-
// Merge with --traits
|
|
76
|
-
const
|
|
77
|
+
// Merge with --traits + --jurisdiction-derived traits
|
|
78
|
+
const jurisdictionTraits = opts.jurisdiction
|
|
79
|
+
? opts.jurisdiction.split(',').map((s) => s.trim()).filter(Boolean).map((c) => `jurisdiction-${c}`)
|
|
80
|
+
: [];
|
|
81
|
+
const finalTraits = [...new Set([...resolved.final_traits, ...traitsFromFlag, ...jurisdictionTraits])].sort();
|
|
77
82
|
|
|
78
83
|
// Build a resolver report for transparency (in both JSON and text modes when description was given)
|
|
79
84
|
const resolverReport = description ? {
|
|
@@ -103,6 +108,18 @@ program
|
|
|
103
108
|
console.error(chalk.red(e.message));
|
|
104
109
|
process.exit(1);
|
|
105
110
|
}
|
|
111
|
+
|
|
112
|
+
// v2.1: jurisdiction filter. classify produces conceptually-relevant areas;
|
|
113
|
+
// we drop EU-tagged areas if user is not in EU jurisdiction (and same for
|
|
114
|
+
// any other jurisdiction-gated area). Universal areas pass through.
|
|
115
|
+
const userJurisdictions = getUserJurisdictions(finalTraits);
|
|
116
|
+
const beforeFilter = result.implement_files.length;
|
|
117
|
+
result.implement_files = filterAreasByJurisdiction(result.implement_files, userJurisdictions);
|
|
118
|
+
result.filtered_by_jurisdiction = {
|
|
119
|
+
user_jurisdictions: [...userJurisdictions],
|
|
120
|
+
dropped_count: beforeFilter - result.implement_files.length,
|
|
121
|
+
};
|
|
122
|
+
|
|
106
123
|
if (resolverReport) result.resolver = resolverReport;
|
|
107
124
|
|
|
108
125
|
if (jsonMode) {
|
|
@@ -207,6 +224,7 @@ program
|
|
|
207
224
|
.argument('<files...>', 'File IDs to verify')
|
|
208
225
|
.option('--auto <path>', 'Run deterministic scanner against the project at <path> instead of returning the blank checklist')
|
|
209
226
|
.option('--json', 'Output auto-verify results as JSON (only with --auto)')
|
|
227
|
+
.option('--jurisdiction <codes>', 'Comma-separated jurisdiction codes (eu, us-regulated). Surfaces jurisdiction-specific control citations (e.g. EU AI Act articles) in the report.')
|
|
210
228
|
.action((files, opts) => {
|
|
211
229
|
if (!opts.auto) {
|
|
212
230
|
// Backward-compatible behavior: fetch the blank checklist markdown
|
|
@@ -223,10 +241,15 @@ program
|
|
|
223
241
|
process.exit(1);
|
|
224
242
|
}
|
|
225
243
|
|
|
244
|
+
// v2.1: parse --jurisdiction once, applied to every area's verify run.
|
|
245
|
+
const jurisdictions = opts.jurisdiction
|
|
246
|
+
? opts.jurisdiction.split(',').map((s) => s.trim()).filter(Boolean)
|
|
247
|
+
: [];
|
|
248
|
+
|
|
226
249
|
const results = [];
|
|
227
250
|
for (const area of files) {
|
|
228
251
|
try {
|
|
229
|
-
const r = autoVerifyArea(area, projectDir);
|
|
252
|
+
const r = autoVerifyArea(area, projectDir, { jurisdictions });
|
|
230
253
|
results.push(r);
|
|
231
254
|
} catch (e) {
|
|
232
255
|
console.error(chalk.red(`Error verifying "${area}": ${e.message}`));
|
|
@@ -307,6 +330,8 @@ program
|
|
|
307
330
|
.option('--list', 'Shape A: print area names + traits + pre-built --confirm/--reject flags only')
|
|
308
331
|
.option('--confirm <ids>', 'Comma-separated low-confidence trigger ids/slugs to confirm (no interactive prompt)')
|
|
309
332
|
.option('--reject <ids>', 'Comma-separated low-confidence trigger ids/slugs to reject (no interactive prompt)')
|
|
333
|
+
.option('--jurisdiction <codes>', 'Comma-separated jurisdiction codes (eu, us-regulated). Adds jurisdiction-* traits and gates EU AI Act / regional content accordingly.')
|
|
334
|
+
.option('--tight', 'Experimental: require ≥2 trait matches for area inclusion (vs default ≥1). Produces smaller briefs; trades some recall for precision.')
|
|
310
335
|
.option('--json', 'Output JSON (brief + meta) instead of plain markdown to stdout')
|
|
311
336
|
.action(async (description, opts) => {
|
|
312
337
|
if (opts.full && opts.compact) {
|
|
@@ -318,10 +343,15 @@ program
|
|
|
318
343
|
process.exit(1);
|
|
319
344
|
}
|
|
320
345
|
|
|
346
|
+
// v2.1: parse --jurisdiction flag once, used by all paths below.
|
|
347
|
+
const extraJurisdictions = opts.jurisdiction
|
|
348
|
+
? opts.jurisdiction.split(',').map((s) => s.trim()).filter(Boolean)
|
|
349
|
+
: [];
|
|
350
|
+
|
|
321
351
|
// --list short-circuit (Shape A)
|
|
322
352
|
if (opts.list) {
|
|
323
353
|
try {
|
|
324
|
-
process.stdout.write(buildList({ description }));
|
|
354
|
+
process.stdout.write(buildList({ description, extraJurisdictions, tight: !!opts.tight }));
|
|
325
355
|
} catch (err) {
|
|
326
356
|
console.error(chalk.red(err.message));
|
|
327
357
|
process.exit(1);
|
|
@@ -383,7 +413,7 @@ program
|
|
|
383
413
|
|
|
384
414
|
let result;
|
|
385
415
|
try {
|
|
386
|
-
result = buildBrief({ description, decisions, mode });
|
|
416
|
+
result = buildBrief({ description, decisions, extraJurisdictions, tight: !!opts.tight, mode });
|
|
387
417
|
} catch (err) {
|
|
388
418
|
if (err instanceof BriefTooLargeError) {
|
|
389
419
|
console.error(chalk.red(err.message));
|
|
@@ -537,6 +567,105 @@ program
|
|
|
537
567
|
process.exit(1);
|
|
538
568
|
});
|
|
539
569
|
|
|
570
|
+
// ============================================================
|
|
571
|
+
// aigis report (v2.1)
|
|
572
|
+
// ============================================================
|
|
573
|
+
program
|
|
574
|
+
.command('report')
|
|
575
|
+
.description('Compile an audit-ready compliance report (verify across multiple areas + cross-framework citations + evidence)')
|
|
576
|
+
.option('--areas <ids>', 'Comma-separated area ids to evaluate (e.g. pii-handling,audit-logging)')
|
|
577
|
+
.option('--from-classify <description>', 'Auto-detect areas: run aigis classify on this description first, then report on the recommended areas')
|
|
578
|
+
.option('--all', 'Evaluate every area in content/skills/areas/ (warning: large output)')
|
|
579
|
+
.option('--project <path>', 'Path to project to scan (default: current directory)', '.')
|
|
580
|
+
.option('--jurisdiction <codes>', 'Comma-separated jurisdiction codes (eu, us-regulated). Surfaces jurisdiction-specific control citations.')
|
|
581
|
+
.option('--format <fmt>', 'Output format: markdown | json (default markdown)', 'markdown')
|
|
582
|
+
.option('--output <path>', 'Write report to file instead of stdout')
|
|
583
|
+
.action(async (opts) => {
|
|
584
|
+
const { buildReport, formatReportMarkdown, formatReportJSON } = require('../lib/report');
|
|
585
|
+
const fs2 = require('fs');
|
|
586
|
+
const pathMod = require('path');
|
|
587
|
+
|
|
588
|
+
const projectDir = pathMod.resolve(opts.project);
|
|
589
|
+
if (!fs2.existsSync(projectDir)) {
|
|
590
|
+
console.error(chalk.red(`Project path does not exist: ${projectDir}`));
|
|
591
|
+
process.exit(1);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
// Resolve area list — exactly one source must be provided.
|
|
595
|
+
const sources = [opts.areas, opts.fromClassify, opts.all].filter(Boolean).length;
|
|
596
|
+
if (sources === 0) {
|
|
597
|
+
console.error(chalk.red('Provide one of --areas <ids>, --from-classify "<description>", or --all.'));
|
|
598
|
+
console.error(chalk.dim(' aigis report --areas pii-handling,audit-logging --project .'));
|
|
599
|
+
console.error(chalk.dim(' aigis report --from-classify "EU credit scoring system" --project .'));
|
|
600
|
+
console.error(chalk.dim(' aigis report --all --project .'));
|
|
601
|
+
process.exit(1);
|
|
602
|
+
}
|
|
603
|
+
if (sources > 1) {
|
|
604
|
+
console.error(chalk.red('Pass exactly one of --areas, --from-classify, --all.'));
|
|
605
|
+
process.exit(1);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
let areas = [];
|
|
609
|
+
const jurisdictions = opts.jurisdiction
|
|
610
|
+
? opts.jurisdiction.split(',').map((s) => s.trim()).filter(Boolean)
|
|
611
|
+
: [];
|
|
612
|
+
|
|
613
|
+
if (opts.areas) {
|
|
614
|
+
areas = opts.areas.split(',').map((s) => s.trim()).filter(Boolean);
|
|
615
|
+
} else if (opts.fromClassify) {
|
|
616
|
+
// Run classify, take its (jurisdiction-filtered) implement_files.
|
|
617
|
+
const { detectTraitsFromText, applyConfirmations } = require('../lib/keywords');
|
|
618
|
+
const detection = detectTraitsFromText(opts.fromClassify);
|
|
619
|
+
const decisions = {};
|
|
620
|
+
for (const sug of detection.low_confidence_matches) decisions[sug.id] = 'no'; // conservative for non-interactive report
|
|
621
|
+
const resolved = applyConfirmations(detection, decisions);
|
|
622
|
+
const jurisdictionTraits = jurisdictions.map((c) => `jurisdiction-${c}`);
|
|
623
|
+
const finalTraits = [...new Set([...resolved.final_traits, ...jurisdictionTraits])].sort();
|
|
624
|
+
if (finalTraits.length === 0) {
|
|
625
|
+
console.error(chalk.red('No traits resolved from --from-classify description. Try --areas <list> instead, or pass a more specific description.'));
|
|
626
|
+
process.exit(1);
|
|
627
|
+
}
|
|
628
|
+
const cls = classify(finalTraits);
|
|
629
|
+
areas = filterAreasByJurisdiction(cls.implement_files, getUserJurisdictions(finalTraits));
|
|
630
|
+
} else {
|
|
631
|
+
// --all: every area markdown file
|
|
632
|
+
const areasDir = pathMod.join(__dirname, '..', 'content', 'skills', 'areas');
|
|
633
|
+
areas = fs2.readdirSync(areasDir)
|
|
634
|
+
.filter((f) => f.endsWith('.md'))
|
|
635
|
+
.map((f) => f.replace(/\.md$/, ''))
|
|
636
|
+
.sort();
|
|
637
|
+
// Apply jurisdiction filter so EU areas don't show for non-EU reports
|
|
638
|
+
areas = filterAreasByJurisdiction(areas, getUserJurisdictions(jurisdictions.map((c) => `jurisdiction-${c}`)));
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
if (areas.length === 0) {
|
|
642
|
+
console.error(chalk.red('No areas to evaluate after jurisdiction filtering. Pass --jurisdiction or different --areas.'));
|
|
643
|
+
process.exit(1);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
let report;
|
|
647
|
+
try {
|
|
648
|
+
report = buildReport({ projectDir, areas, jurisdictions });
|
|
649
|
+
} catch (err) {
|
|
650
|
+
console.error(chalk.red(err.message));
|
|
651
|
+
process.exit(1);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
const fmt = (opts.format || 'markdown').toLowerCase();
|
|
655
|
+
let output;
|
|
656
|
+
if (fmt === 'json') output = formatReportJSON(report);
|
|
657
|
+
else if (fmt === 'markdown' || fmt === 'md') output = formatReportMarkdown(report);
|
|
658
|
+
else { console.error(chalk.red(`Unknown --format "${opts.format}". Use markdown or json.`)); process.exit(1); }
|
|
659
|
+
|
|
660
|
+
if (opts.output) {
|
|
661
|
+
fs2.writeFileSync(opts.output, output + (output.endsWith('\n') ? '' : '\n'));
|
|
662
|
+
console.error(chalk.green(`Report written to ${opts.output} (${output.length} chars, ${areas.length} area${areas.length === 1 ? '' : 's'} evaluated)`));
|
|
663
|
+
} else {
|
|
664
|
+
process.stdout.write(output);
|
|
665
|
+
if (!output.endsWith('\n')) process.stdout.write('\n');
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
|
|
540
669
|
// ============================================================
|
|
541
670
|
// aigis search
|
|
542
671
|
// ============================================================
|
|
@@ -634,11 +763,13 @@ program
|
|
|
634
763
|
// ============================================================
|
|
635
764
|
program
|
|
636
765
|
.command('init')
|
|
637
|
-
.description('Set up aigis for your IDE (writes core skill + resolver block)')
|
|
766
|
+
.description('Set up aigis for your IDE (writes core skill + resolver block). Optional --ci and --hook activation surfaces.')
|
|
638
767
|
.argument('<ide>', 'IDE to configure: cursor, claude-code, windsurf, copilot')
|
|
639
768
|
.option('--refresh', 'Overwrite existing aigis content (destructive — use after Aigis updates or to fix a stale resolver block checksum)')
|
|
769
|
+
.option('--ci <provider>', 'Install CI workflow file. Currently supports: github (drops .github/workflows/aigis.yml).')
|
|
770
|
+
.option('--hook', 'Install .git/hooks/pre-commit that runs aigis verify on areas declared in .aigisrc.json.')
|
|
640
771
|
.action((ide, opts) => {
|
|
641
|
-
init(ide, { refresh: !!opts.refresh });
|
|
772
|
+
init(ide, { refresh: !!opts.refresh, ci: opts.ci, hook: !!opts.hook });
|
|
642
773
|
});
|
|
643
774
|
|
|
644
775
|
// ============================================================
|