@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.
Files changed (111) hide show
  1. package/README.md +97 -178
  2. package/bin/aigis.js +139 -8
  3. package/content/resolvers/triggers.json +363 -41
  4. package/content/skills/areas/audit-logging.md +33 -0
  5. package/content/skills/areas/bias-monitoring.md +34 -0
  6. package/content/skills/areas/confidence-scoring.md +23 -0
  7. package/content/skills/areas/data-integrity.md +25 -0
  8. package/content/skills/areas/eu-ai-act-art-13-deployer-transparency.md +133 -0
  9. package/content/skills/areas/eu-ai-act-art-50-transparency-disclosure.md +134 -0
  10. package/content/skills/areas/eu-ai-act-art-73-incident-reporting.md +149 -0
  11. package/content/skills/areas/eu-ai-act-art-9-risk-management.md +141 -0
  12. package/content/skills/areas/fallback-patterns.md +28 -0
  13. package/content/skills/areas/human-oversight.md +38 -0
  14. package/content/skills/areas/input-validation.md +27 -0
  15. package/content/skills/areas/monitoring.md +29 -0
  16. package/content/skills/areas/prompt-security.md +29 -0
  17. package/content/templates/eu-ai-act-annex-iv.md +193 -0
  18. package/docs/frontmatter-schema.md +75 -0
  19. package/docs/screenshots/README.md +17 -0
  20. package/docs/screenshots/agent-flow.png +0 -0
  21. package/docs/screenshots/setup.png +0 -0
  22. package/docs/screenshots/verify.png +0 -0
  23. package/lib/auto-verify.js +70 -1
  24. package/lib/build.js +101 -12
  25. package/lib/classify.js +8 -2
  26. package/lib/init.js +269 -5
  27. package/lib/jurisdiction.js +137 -0
  28. package/lib/report.js +331 -0
  29. package/package.json +1 -1
  30. package/scripts/area-controls-baseline.json +188 -0
  31. package/scripts/area-frontmatter.schema.json +61 -0
  32. package/scripts/validate-area-frontmatter.js +228 -0
  33. package/cli-python/LICENSE +0 -21
  34. package/cli-python/README.md +0 -32
  35. package/cli-python/aigis_cli/SKILL.md +0 -70
  36. package/cli-python/aigis_cli/__init__.py +0 -3
  37. package/cli-python/aigis_cli/__pycache__/__init__.cpython-313.pyc +0 -0
  38. package/cli-python/aigis_cli/__pycache__/annotate.cpython-313.pyc +0 -0
  39. package/cli-python/aigis_cli/__pycache__/build.cpython-313.pyc +0 -0
  40. package/cli-python/aigis_cli/__pycache__/checksum.cpython-313.pyc +0 -0
  41. package/cli-python/aigis_cli/__pycache__/classify.cpython-313.pyc +0 -0
  42. package/cli-python/aigis_cli/__pycache__/cli.cpython-313.pyc +0 -0
  43. package/cli-python/aigis_cli/__pycache__/fetch.cpython-313.pyc +0 -0
  44. package/cli-python/aigis_cli/__pycache__/init_ide.cpython-313.pyc +0 -0
  45. package/cli-python/aigis_cli/__pycache__/keywords.cpython-313.pyc +0 -0
  46. package/cli-python/aigis_cli/__pycache__/search.cpython-313.pyc +0 -0
  47. package/cli-python/aigis_cli/annotate.py +0 -45
  48. package/cli-python/aigis_cli/auto_verify.py +0 -518
  49. package/cli-python/aigis_cli/build.py +0 -470
  50. package/cli-python/aigis_cli/checksum.py +0 -22
  51. package/cli-python/aigis_cli/classify.py +0 -192
  52. package/cli-python/aigis_cli/cli.py +0 -618
  53. package/cli-python/aigis_cli/content/index/audit-scan.md +0 -217
  54. package/cli-python/aigis_cli/content/index/auto-verify-rules.json +0 -439
  55. package/cli-python/aigis_cli/content/index/context-rules.json +0 -90
  56. package/cli-python/aigis_cli/content/index/frameworks.md +0 -82
  57. package/cli-python/aigis_cli/content/index/guardrails.json +0 -23
  58. package/cli-python/aigis_cli/content/index/taxonomy.md +0 -81
  59. package/cli-python/aigis_cli/content/resolvers/triggers.json +0 -229
  60. package/cli-python/aigis_cli/content/skills/areas/audit-logging.md +0 -176
  61. package/cli-python/aigis_cli/content/skills/areas/bias-monitoring.md +0 -172
  62. package/cli-python/aigis_cli/content/skills/areas/confidence-scoring.md +0 -180
  63. package/cli-python/aigis_cli/content/skills/areas/data-integrity.md +0 -257
  64. package/cli-python/aigis_cli/content/skills/areas/explainability.md +0 -174
  65. package/cli-python/aigis_cli/content/skills/areas/fallback-patterns.md +0 -200
  66. package/cli-python/aigis_cli/content/skills/areas/human-oversight.md +0 -220
  67. package/cli-python/aigis_cli/content/skills/areas/input-validation.md +0 -380
  68. package/cli-python/aigis_cli/content/skills/areas/monitoring.md +0 -207
  69. package/cli-python/aigis_cli/content/skills/areas/output-sanitization.md +0 -183
  70. package/cli-python/aigis_cli/content/skills/areas/pii-handling.md +0 -189
  71. package/cli-python/aigis_cli/content/skills/areas/prompt-security.md +0 -153
  72. package/cli-python/aigis_cli/content/skills/areas/rag-security.md +0 -230
  73. package/cli-python/aigis_cli/content/skills/areas/rate-limiting.md +0 -246
  74. package/cli-python/aigis_cli/content/skills/areas/supply-chain.md +0 -193
  75. package/cli-python/aigis_cli/content/skills/core.md +0 -62
  76. package/cli-python/aigis_cli/content/skills/infrastructure/logging.md +0 -202
  77. package/cli-python/aigis_cli/content/skills/infrastructure/rate-limiting.md +0 -169
  78. package/cli-python/aigis_cli/content/skills/infrastructure/secrets.md +0 -167
  79. package/cli-python/aigis_cli/content/skills/workflows/fastapi-llm.md +0 -86
  80. package/cli-python/aigis_cli/content/templates/ai-impact-assessment.md +0 -54
  81. package/cli-python/aigis_cli/content/templates/intended-purpose-doc.md +0 -39
  82. package/cli-python/aigis_cli/content/templates/risk-characterization.md +0 -34
  83. package/cli-python/aigis_cli/content/templates/third-party-assessment.md +0 -41
  84. package/cli-python/aigis_cli/content/verify/checklist-audit-logging.md +0 -13
  85. package/cli-python/aigis_cli/content/verify/checklist-bias-monitoring.md +0 -13
  86. package/cli-python/aigis_cli/content/verify/checklist-confidence-scoring.md +0 -13
  87. package/cli-python/aigis_cli/content/verify/checklist-data-integrity.md +0 -12
  88. package/cli-python/aigis_cli/content/verify/checklist-explainability.md +0 -13
  89. package/cli-python/aigis_cli/content/verify/checklist-fallback-patterns.md +0 -13
  90. package/cli-python/aigis_cli/content/verify/checklist-human-oversight.md +0 -14
  91. package/cli-python/aigis_cli/content/verify/checklist-input-validation.md +0 -16
  92. package/cli-python/aigis_cli/content/verify/checklist-monitoring.md +0 -13
  93. package/cli-python/aigis_cli/content/verify/checklist-output-sanitization.md +0 -14
  94. package/cli-python/aigis_cli/content/verify/checklist-pii-handling.md +0 -14
  95. package/cli-python/aigis_cli/content/verify/checklist-prompt-security.md +0 -13
  96. package/cli-python/aigis_cli/content/verify/checklist-rag-security.md +0 -12
  97. package/cli-python/aigis_cli/content/verify/checklist-rate-limiting.md +0 -13
  98. package/cli-python/aigis_cli/content/verify/checklist-supply-chain.md +0 -13
  99. package/cli-python/aigis_cli/fetch.py +0 -232
  100. package/cli-python/aigis_cli/init_ide.py +0 -159
  101. package/cli-python/aigis_cli/keywords.py +0 -73
  102. package/cli-python/aigis_cli/search.py +0 -69
  103. package/cli-python/aigis_cli.egg-info/PKG-INFO +0 -59
  104. package/cli-python/aigis_cli.egg-info/SOURCES.txt +0 -56
  105. package/cli-python/aigis_cli.egg-info/dependency_links.txt +0 -1
  106. package/cli-python/aigis_cli.egg-info/entry_points.txt +0 -2
  107. package/cli-python/aigis_cli.egg-info/requires.txt +0 -6
  108. package/cli-python/aigis_cli.egg-info/top_level.txt +0 -1
  109. package/cli-python/dist/aigis_cli-1.0.3-py3-none-any.whl +0 -0
  110. package/cli-python/dist/aigis_cli-1.0.3.tar.gz +0 -0
  111. package/cli-python/pyproject.toml +0 -49
@@ -0,0 +1,61 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Aigis area frontmatter schema",
4
+ "description": "YAML frontmatter contract for content/skills/areas/*.md. See docs/frontmatter-schema.md for full semantics.",
5
+ "type": "object",
6
+ "required": ["id", "title", "controls", "min_risk_tier", "system_traits"],
7
+ "additionalProperties": true,
8
+ "properties": {
9
+ "id": {
10
+ "type": "string",
11
+ "pattern": "^[a-z][a-z0-9-]*$",
12
+ "description": "Must equal the filename without .md."
13
+ },
14
+ "title": {
15
+ "type": "string",
16
+ "minLength": 1
17
+ },
18
+ "controls": {
19
+ "type": "object",
20
+ "required": ["owasp", "nist", "iso42001"],
21
+ "additionalProperties": false,
22
+ "properties": {
23
+ "owasp": {
24
+ "type": "array",
25
+ "items": { "type": "string", "pattern": "^LLM\\d{2}$" }
26
+ },
27
+ "nist": {
28
+ "type": "array",
29
+ "items": { "type": "string", "pattern": "^(MAP|MEASURE|MANAGE|GOVERN)-\\d+(\\.\\d+)?$" }
30
+ },
31
+ "iso42001": {
32
+ "type": "array",
33
+ "items": { "type": "string", "pattern": "^(Clause-\\d+(\\.\\d+)?|Annex-[A-Z](\\.\\d+)?|Annex-[A-Z])$" }
34
+ },
35
+ "eu_ai_act": {
36
+ "type": "array",
37
+ "items": {
38
+ "type": "string",
39
+ "pattern": "^(Art-\\d+(\\([0-9a-z]+\\))*|Annex-[IVX]+(\\([0-9a-z]+\\))*)$"
40
+ },
41
+ "description": "EU AI Act article references. v2.1 addition. Optional."
42
+ }
43
+ }
44
+ },
45
+ "min_risk_tier": {
46
+ "type": "string",
47
+ "enum": ["low", "medium", "high", "all"]
48
+ },
49
+ "system_traits": {
50
+ "type": "array",
51
+ "minItems": 1,
52
+ "items": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" }
53
+ },
54
+ "jurisdiction": {
55
+ "type": "array",
56
+ "minItems": 1,
57
+ "items": { "type": "string", "enum": ["eu", "us-regulated"] },
58
+ "description": "Gates which framework controls render in brief. v2.1 addition. Optional. Absence = applies to all jurisdictions."
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,228 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Validates frontmatter on every file in content/skills/areas/*.md.
4
+ *
5
+ * Schema: scripts/area-frontmatter.schema.json (reference doc, also validated
6
+ * here by a hand-rolled subset of JSON Schema — same approach as
7
+ * scripts/validate-triggers.js, no ajv dep).
8
+ *
9
+ * Doc: docs/frontmatter-schema.md
10
+ *
11
+ * Exit codes:
12
+ * 0 All area files satisfy the schema.
13
+ * 1 At least one file failed; offending entries printed to stderr.
14
+ *
15
+ * Used by .github/workflows/area-frontmatter-validation.yml on PRs that touch
16
+ * content/skills/areas/. Also runs locally:
17
+ * node scripts/validate-area-frontmatter.js
18
+ */
19
+
20
+ const fs = require('fs');
21
+ const path = require('path');
22
+ const matter = require('gray-matter');
23
+
24
+ const ROOT = path.join(__dirname, '..');
25
+ const AREAS_DIR = path.join(ROOT, 'content', 'skills', 'areas');
26
+ const BASELINE_PATH = path.join(__dirname, 'area-controls-baseline.json');
27
+ const { ALL_TRAITS } = require(path.join(ROOT, 'lib', 'classify.js'));
28
+ const ALL_TRAITS_SET = new Set(ALL_TRAITS);
29
+
30
+ // v2.1 no-deletion baseline: existing area files (those listed in
31
+ // area-controls-baseline.json, captured at v2.0.2) must preserve their
32
+ // owasp/nist/iso42001 control arrays. Adding new framework citations
33
+ // (eu_ai_act) is fine; removing or modifying existing ones is a
34
+ // regression that breaks audit traceability.
35
+ let _baselineCache = null;
36
+ function loadBaseline() {
37
+ if (_baselineCache) return _baselineCache;
38
+ if (!fs.existsSync(BASELINE_PATH)) {
39
+ _baselineCache = {};
40
+ return _baselineCache;
41
+ }
42
+ _baselineCache = JSON.parse(fs.readFileSync(BASELINE_PATH, 'utf8'));
43
+ return _baselineCache;
44
+ }
45
+
46
+ function arraysEqualSet(a, b) {
47
+ const sa = new Set(a || []); const sb = new Set(b || []);
48
+ if (sa.size !== sb.size) return false;
49
+ for (const x of sa) if (!sb.has(x)) return false;
50
+ return true;
51
+ }
52
+
53
+ const RISK_TIERS = new Set(['low', 'medium', 'high', 'all']);
54
+ const JURISDICTIONS = new Set(['eu', 'us-regulated']);
55
+
56
+ const RE_ID = /^[a-z][a-z0-9-]*$/;
57
+ const RE_OWASP = /^LLM\d{2}$/;
58
+ const RE_NIST = /^(MAP|MEASURE|MANAGE|GOVERN)-\d+(\.\d+)?$/;
59
+ const RE_ISO = /^(Clause-\d+(\.\d+)?|Annex-[A-Z](\.\d+)?|Annex-[A-Z])$/;
60
+ const RE_EU_AI_ACT = /^(Art-\d+(\([0-9a-z]+\))*|Annex-[IVX]+(\([0-9a-z]+\))*)$/;
61
+
62
+ function listAreaFiles() {
63
+ return fs.readdirSync(AREAS_DIR)
64
+ .filter((f) => f.endsWith('.md'))
65
+ .sort();
66
+ }
67
+
68
+ function validateOne(filename) {
69
+ const errors = [];
70
+ const filepath = path.join(AREAS_DIR, filename);
71
+ const expectedId = filename.replace(/\.md$/, '');
72
+ const raw = fs.readFileSync(filepath, 'utf8');
73
+
74
+ let parsed;
75
+ try {
76
+ parsed = matter(raw);
77
+ } catch (e) {
78
+ return [`frontmatter parse error: ${e.message}`];
79
+ }
80
+ const fm = parsed.data;
81
+
82
+ // ── Required fields present
83
+ for (const field of ['id', 'title', 'controls', 'min_risk_tier', 'system_traits']) {
84
+ if (!(field in fm)) errors.push(`missing required field: ${field}`);
85
+ }
86
+ if (errors.length > 0) return errors;
87
+
88
+ // ── id must match filename
89
+ if (typeof fm.id !== 'string' || !RE_ID.test(fm.id)) {
90
+ errors.push(`id "${fm.id}" must be lowercase-kebab-case`);
91
+ } else if (fm.id !== expectedId) {
92
+ errors.push(`id "${fm.id}" must match filename "${expectedId}"`);
93
+ }
94
+
95
+ // ── title is non-empty string
96
+ if (typeof fm.title !== 'string' || fm.title.length === 0) {
97
+ errors.push('title must be a non-empty string');
98
+ }
99
+
100
+ // ── controls shape
101
+ if (typeof fm.controls !== 'object' || Array.isArray(fm.controls) || fm.controls === null) {
102
+ errors.push('controls must be an object');
103
+ } else {
104
+ for (const key of ['owasp', 'nist', 'iso42001']) {
105
+ if (!(key in fm.controls)) {
106
+ errors.push(`controls.${key} is required (may be an empty array)`);
107
+ } else if (!Array.isArray(fm.controls[key])) {
108
+ errors.push(`controls.${key} must be an array`);
109
+ }
110
+ }
111
+ // Validate control identifier patterns where the array exists
112
+ for (const v of fm.controls.owasp || []) {
113
+ if (typeof v !== 'string' || !RE_OWASP.test(v)) {
114
+ errors.push(`controls.owasp value "${v}" does not match LLM##`);
115
+ }
116
+ }
117
+ for (const v of fm.controls.nist || []) {
118
+ if (typeof v !== 'string' || !RE_NIST.test(v)) {
119
+ errors.push(`controls.nist value "${v}" does not match <FUNCTION>-N.N`);
120
+ }
121
+ }
122
+ for (const v of fm.controls.iso42001 || []) {
123
+ if (typeof v !== 'string' || !RE_ISO.test(v)) {
124
+ errors.push(`controls.iso42001 value "${v}" does not match Clause-N or Annex-X[.N]`);
125
+ }
126
+ }
127
+ // eu_ai_act is OPTIONAL — only validate if present
128
+ if ('eu_ai_act' in fm.controls) {
129
+ if (!Array.isArray(fm.controls.eu_ai_act)) {
130
+ errors.push('controls.eu_ai_act must be an array if present');
131
+ } else {
132
+ for (const v of fm.controls.eu_ai_act) {
133
+ if (typeof v !== 'string' || !RE_EU_AI_ACT.test(v)) {
134
+ errors.push(`controls.eu_ai_act value "${v}" does not match Art-N[(N)(letter)] or Annex-X[(N)]`);
135
+ }
136
+ }
137
+ }
138
+ }
139
+ // No other keys allowed under controls
140
+ for (const k of Object.keys(fm.controls)) {
141
+ if (!['owasp', 'nist', 'iso42001', 'eu_ai_act'].includes(k)) {
142
+ errors.push(`controls.${k} is not a recognized framework key`);
143
+ }
144
+ }
145
+ // ── v2.1 no-deletion check: existing areas must preserve their
146
+ // owasp/nist/iso42001 arrays from the v2.0.2 baseline. Adding
147
+ // eu_ai_act is fine; modifying the original three is a regression.
148
+ const baseline = loadBaseline();
149
+ if (baseline[expectedId]) {
150
+ for (const fw of ['owasp', 'nist', 'iso42001']) {
151
+ if (!arraysEqualSet(fm.controls[fw], baseline[expectedId][fw])) {
152
+ const before = JSON.stringify(baseline[expectedId][fw]);
153
+ const after = JSON.stringify(fm.controls[fw] || []);
154
+ errors.push(
155
+ `controls.${fw} changed from baseline ${before} → ${after}. ` +
156
+ `Existing framework controls must be preserved (additive-only rule). ` +
157
+ `If the change is intentional, update scripts/area-controls-baseline.json in the same commit.`
158
+ );
159
+ }
160
+ }
161
+ }
162
+ }
163
+
164
+ // ── min_risk_tier
165
+ if (!RISK_TIERS.has(fm.min_risk_tier)) {
166
+ errors.push(`min_risk_tier "${fm.min_risk_tier}" must be one of low | medium | high | all`);
167
+ }
168
+
169
+ // ── system_traits
170
+ if (!Array.isArray(fm.system_traits) || fm.system_traits.length === 0) {
171
+ errors.push('system_traits must be a non-empty array');
172
+ } else {
173
+ for (const t of fm.system_traits) {
174
+ if (typeof t !== 'string' || !RE_ID.test(t)) {
175
+ errors.push(`system_traits value "${t}" must be lowercase-kebab-case`);
176
+ } else if (!ALL_TRAITS_SET.has(t)) {
177
+ errors.push(`system_traits value "${t}" is not in lib/classify.js ALL_TRAITS`);
178
+ }
179
+ }
180
+ }
181
+
182
+ // ── jurisdiction (optional)
183
+ if ('jurisdiction' in fm) {
184
+ if (!Array.isArray(fm.jurisdiction) || fm.jurisdiction.length === 0) {
185
+ errors.push('jurisdiction must be a non-empty array if present');
186
+ } else {
187
+ for (const j of fm.jurisdiction) {
188
+ if (!JURISDICTIONS.has(j)) {
189
+ errors.push(`jurisdiction value "${j}" must be one of: ${[...JURISDICTIONS].join(', ')}`);
190
+ }
191
+ }
192
+ }
193
+ }
194
+
195
+ return errors;
196
+ }
197
+
198
+ function main() {
199
+ const files = listAreaFiles();
200
+ if (files.length === 0) {
201
+ console.error(`No area files found in ${AREAS_DIR}`);
202
+ process.exit(1);
203
+ }
204
+
205
+ let totalErrors = 0;
206
+ let firstErrorFile = null;
207
+ for (const f of files) {
208
+ const errs = validateOne(f);
209
+ if (errs.length > 0) {
210
+ totalErrors += errs.length;
211
+ if (!firstErrorFile) firstErrorFile = f;
212
+ console.error(`\n✗ ${f}`);
213
+ for (const e of errs) console.error(` ${e}`);
214
+ } else {
215
+ console.log(` ✓ ${f}`);
216
+ }
217
+ }
218
+
219
+ if (totalErrors > 0) {
220
+ console.error(`\nFAIL: ${totalErrors} schema error${totalErrors === 1 ? '' : 's'} across ${files.length} area file${files.length === 1 ? '' : 's'} (first failure: ${firstErrorFile}).`);
221
+ console.error('See docs/frontmatter-schema.md for the schema contract.');
222
+ process.exit(1);
223
+ }
224
+ console.log(`\nPASS: all ${files.length} area files satisfy the schema.`);
225
+ }
226
+
227
+ if (require.main === module) main();
228
+ module.exports = { validateOne, listAreaFiles };
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Nayan Kanaparthi
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.
@@ -1,32 +0,0 @@
1
- # aigis-cli (Python)
2
-
3
- AI governance guardrails for coding agents. Python port of the [@aigis-ai/cli](https://www.npmjs.com/package/@aigis-ai/cli) npm package.
4
-
5
- Curated, agent-consumable security and compliance patterns from NIST AI RMF, OWASP Top 10 for LLMs, and ISO/IEC 42001.
6
-
7
- ## Install
8
-
9
- ```bash
10
- pip install aigis-cli
11
- ```
12
-
13
- ## Quick start
14
-
15
- ```bash
16
- aigis classify --traits uses-llm,processes-pii,accepts-user-input
17
- aigis get input-validation pii-handling
18
- aigis verify input-validation pii-handling
19
- aigis template ai-impact-assessment
20
- aigis audit --scan
21
- aigis search pii
22
- aigis traits
23
- aigis init cursor
24
- ```
25
-
26
- ## Documentation
27
-
28
- See the full documentation at [github.com/NayanKanaparthi/aigis](https://github.com/NayanKanaparthi/aigis).
29
-
30
- ## License
31
-
32
- [MIT](LICENSE)
@@ -1,70 +0,0 @@
1
- ---
2
- name: aigis
3
- description: AI governance skill for coding agents. Provides framework-aligned security and compliance patterns from NIST AI RMF, OWASP Top 10 for LLMs, and ISO/IEC 42001. Use before building any AI/LLM feature or when auditing existing AI systems.
4
- ---
5
-
6
- # Aigis — AI Governance Skill
7
-
8
- Use the aigis CLI for governance patterns when building or auditing AI/LLM features.
9
-
10
- ## Quick start — new feature
11
- 1. aigis classify --traits <relevant-traits> --json
12
- 2. For EACH file in the implement_files list, one at a time:
13
- a. aigis get <file-id>
14
- b. Implement the patterns in the code
15
- c. aigis verify <file-id>
16
- d. Fix any FAIL or PARTIAL items until all checks pass
17
- e. Move to the next file
18
- 3. After all files pass, generate required templates:
19
- aigis template <template-id>
20
-
21
- IMPORTANT: Do NOT fetch all implement files at once. Work through them one at a time. Implement fully and verify before moving to the next.
22
-
23
- ## Quick start — audit existing project
24
- \`\`\`bash
25
- # 1. Get the structured audit scan prompt
26
- aigis audit --scan
27
-
28
- # 2. Follow the scan instructions: inventory the project, detect traits, classify
29
-
30
- # 3. Run the full audit with detected traits
31
- aigis audit --traits uses-llm,processes-pii,is-external
32
-
33
- # 4. Evaluate existing code against each check, produce gap report
34
- \`\`\`
35
-
36
- ## When to use
37
- - Before writing any LLM API call or AI feature (new code)
38
- - When auditing an existing AI system for governance gaps (existing code)
39
- - Before processing any sensitive data through an AI system
40
- - Before deploying any AI feature to production
41
- - When onboarding to a new AI project to understand what controls exist
42
-
43
- ## Commands
44
- - \`aigis classify --traits <comma-separated>\` — get risk tier and relevant files
45
- - \`aigis classify "<description>"\` — same, using natural language (keyword matching)
46
- - \`aigis get <file-id> [file-id...]\` — fetch implementation patterns (one or more)
47
- - \`aigis get <file-id> --lang py|js\` — fetch filtered to one language
48
- - \`aigis verify <file-id> [file-id...]\` — fetch verification checklists
49
- - \`aigis template <template-id> [template-id...]\` — fetch compliance documentation templates
50
- - \`aigis audit --scan\` — get structured audit prompt for scanning existing codebases
51
- - \`aigis audit --traits <comma-separated>\` — get bundled classification + all checklists for audit
52
- - \`aigis search <query>\` — search across all content by keyword or control ID
53
- - \`aigis search --list\` — list all available files
54
- - \`aigis annotate <file-id> "<note>"\` — attach a local note for future sessions
55
- - \`aigis annotate --list\` — list all annotations
56
- - \`aigis init cursor|claude-code|windsurf|copilot\` — set up aigis for your IDE
57
-
58
- ## Available traits (22)
59
- AI architecture: uses-llm, uses-rag, uses-finetuned, uses-thirdparty-api, is-agentic, is-multimodal
60
- Data sensitivity: processes-pii, handles-financial, handles-health, handles-proprietary, handles-minors
61
- Impact scope: influences-decisions, accepts-user-input, is-external, is-internal, is-high-volume
62
- Output type: generates-code, generates-content, multi-model-pipeline
63
- Jurisdiction: jurisdiction-eu, jurisdiction-us-regulated, jurisdiction-global
64
-
65
- ## Integration
66
- - Claude Code: place this file in ~/.claude/skills/aigis/SKILL.md
67
- - Cursor: run \`aigis init cursor\` in your project root
68
- - Windsurf: run \`aigis init windsurf\` in your project root
69
- - GitHub Copilot: run \`aigis init copilot\` in your project root
70
- - Any agent: include aigis usage instructions in system prompt
@@ -1,3 +0,0 @@
1
- """aigis-cli: AI governance guardrails for coding agents."""
2
-
3
- __version__ = "2.0.0"
@@ -1,45 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import json
4
- from datetime import date
5
- from pathlib import Path
6
-
7
- AIGIS_DIR = Path.home() / ".aigis"
8
- ANNOTATIONS_FILE = AIGIS_DIR / "annotations.json"
9
-
10
-
11
- def _load_annotations() -> dict:
12
- if not ANNOTATIONS_FILE.exists():
13
- return {}
14
- try:
15
- return json.loads(ANNOTATIONS_FILE.read_text(encoding="utf-8"))
16
- except (json.JSONDecodeError, OSError):
17
- return {}
18
-
19
-
20
- def _save_annotations(data: dict) -> None:
21
- AIGIS_DIR.mkdir(parents=True, exist_ok=True)
22
- ANNOTATIONS_FILE.write_text(json.dumps(data, indent=2), encoding="utf-8")
23
-
24
-
25
- def annotate(file_id: str, note: str) -> None:
26
- data = _load_annotations()
27
- data.setdefault(file_id, []).append({
28
- "note": note,
29
- "date": date.today().isoformat(),
30
- })
31
- _save_annotations(data)
32
-
33
-
34
- def get_annotations(file_id: str) -> list[dict]:
35
- return _load_annotations().get(file_id, [])
36
-
37
-
38
- def list_annotations() -> dict:
39
- return _load_annotations()
40
-
41
-
42
- def clear_annotation(file_id: str) -> None:
43
- data = _load_annotations()
44
- data.pop(file_id, None)
45
- _save_annotations(data)