@aigis-ai/cli 1.0.2 → 2.0.1

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 (124) hide show
  1. package/CONTRIBUTING.md +53 -0
  2. package/SKILL.md +20 -55
  3. package/bin/aigis.js +446 -59
  4. package/cli-python/LICENSE +21 -0
  5. package/cli-python/README.md +32 -0
  6. package/cli-python/aigis_cli/SKILL.md +70 -0
  7. package/cli-python/aigis_cli/__init__.py +3 -0
  8. package/cli-python/aigis_cli/__pycache__/__init__.cpython-313.pyc +0 -0
  9. package/cli-python/aigis_cli/__pycache__/annotate.cpython-313.pyc +0 -0
  10. package/cli-python/aigis_cli/__pycache__/build.cpython-313.pyc +0 -0
  11. package/cli-python/aigis_cli/__pycache__/checksum.cpython-313.pyc +0 -0
  12. package/cli-python/aigis_cli/__pycache__/classify.cpython-313.pyc +0 -0
  13. package/cli-python/aigis_cli/__pycache__/cli.cpython-313.pyc +0 -0
  14. package/cli-python/aigis_cli/__pycache__/fetch.cpython-313.pyc +0 -0
  15. package/cli-python/aigis_cli/__pycache__/init_ide.cpython-313.pyc +0 -0
  16. package/cli-python/aigis_cli/__pycache__/keywords.cpython-313.pyc +0 -0
  17. package/cli-python/aigis_cli/__pycache__/search.cpython-313.pyc +0 -0
  18. package/cli-python/aigis_cli/annotate.py +45 -0
  19. package/cli-python/aigis_cli/auto_verify.py +518 -0
  20. package/cli-python/aigis_cli/build.py +470 -0
  21. package/cli-python/aigis_cli/checksum.py +22 -0
  22. package/cli-python/aigis_cli/classify.py +192 -0
  23. package/cli-python/aigis_cli/cli.py +618 -0
  24. package/cli-python/aigis_cli/content/index/audit-scan.md +217 -0
  25. package/cli-python/aigis_cli/content/index/auto-verify-rules.json +439 -0
  26. package/cli-python/aigis_cli/content/index/context-rules.json +90 -0
  27. package/cli-python/aigis_cli/content/index/frameworks.md +82 -0
  28. package/cli-python/aigis_cli/content/index/guardrails.json +23 -0
  29. package/cli-python/aigis_cli/content/index/taxonomy.md +81 -0
  30. package/cli-python/aigis_cli/content/resolvers/triggers.json +229 -0
  31. package/{content/implement → cli-python/aigis_cli/content/skills/areas}/audit-logging.md +5 -0
  32. package/cli-python/aigis_cli/content/skills/areas/fallback-patterns.md +200 -0
  33. package/cli-python/aigis_cli/content/skills/areas/input-validation.md +380 -0
  34. package/cli-python/aigis_cli/content/skills/areas/pii-handling.md +189 -0
  35. package/cli-python/aigis_cli/content/skills/areas/rate-limiting.md +246 -0
  36. package/cli-python/aigis_cli/content/skills/core.md +62 -0
  37. package/cli-python/aigis_cli/content/skills/infrastructure/logging.md +202 -0
  38. package/cli-python/aigis_cli/content/skills/infrastructure/rate-limiting.md +169 -0
  39. package/cli-python/aigis_cli/content/skills/infrastructure/secrets.md +167 -0
  40. package/cli-python/aigis_cli/content/skills/workflows/fastapi-llm.md +86 -0
  41. package/cli-python/aigis_cli/content/templates/ai-impact-assessment.md +54 -0
  42. package/cli-python/aigis_cli/content/templates/intended-purpose-doc.md +39 -0
  43. package/cli-python/aigis_cli/content/templates/risk-characterization.md +34 -0
  44. package/cli-python/aigis_cli/content/templates/third-party-assessment.md +41 -0
  45. package/cli-python/aigis_cli/content/verify/checklist-audit-logging.md +13 -0
  46. package/cli-python/aigis_cli/content/verify/checklist-bias-monitoring.md +13 -0
  47. package/cli-python/aigis_cli/content/verify/checklist-confidence-scoring.md +13 -0
  48. package/cli-python/aigis_cli/content/verify/checklist-data-integrity.md +12 -0
  49. package/cli-python/aigis_cli/content/verify/checklist-explainability.md +13 -0
  50. package/cli-python/aigis_cli/content/verify/checklist-fallback-patterns.md +13 -0
  51. package/cli-python/aigis_cli/content/verify/checklist-human-oversight.md +14 -0
  52. package/cli-python/aigis_cli/content/verify/checklist-input-validation.md +16 -0
  53. package/cli-python/aigis_cli/content/verify/checklist-monitoring.md +13 -0
  54. package/cli-python/aigis_cli/content/verify/checklist-output-sanitization.md +14 -0
  55. package/cli-python/aigis_cli/content/verify/checklist-pii-handling.md +14 -0
  56. package/cli-python/aigis_cli/content/verify/checklist-prompt-security.md +13 -0
  57. package/cli-python/aigis_cli/content/verify/checklist-rag-security.md +12 -0
  58. package/cli-python/aigis_cli/content/verify/checklist-rate-limiting.md +13 -0
  59. package/cli-python/aigis_cli/content/verify/checklist-supply-chain.md +13 -0
  60. package/cli-python/aigis_cli/fetch.py +232 -0
  61. package/cli-python/aigis_cli/init_ide.py +159 -0
  62. package/cli-python/aigis_cli/keywords.py +73 -0
  63. package/cli-python/aigis_cli/search.py +69 -0
  64. package/cli-python/aigis_cli.egg-info/PKG-INFO +59 -0
  65. package/cli-python/aigis_cli.egg-info/SOURCES.txt +56 -0
  66. package/cli-python/aigis_cli.egg-info/dependency_links.txt +1 -0
  67. package/cli-python/aigis_cli.egg-info/entry_points.txt +2 -0
  68. package/cli-python/aigis_cli.egg-info/requires.txt +6 -0
  69. package/cli-python/aigis_cli.egg-info/top_level.txt +1 -0
  70. package/cli-python/dist/aigis_cli-1.0.3-py3-none-any.whl +0 -0
  71. package/cli-python/dist/aigis_cli-1.0.3.tar.gz +0 -0
  72. package/cli-python/pyproject.toml +49 -0
  73. package/content/index/audit-scan.md +21 -207
  74. package/content/index/auto-verify-rules.json +439 -0
  75. package/content/index/context-rules.json +90 -0
  76. package/content/resolvers/triggers.json +229 -0
  77. package/content/skills/areas/audit-logging.md +176 -0
  78. package/content/skills/areas/bias-monitoring.md +172 -0
  79. package/content/skills/areas/confidence-scoring.md +180 -0
  80. package/content/skills/areas/data-integrity.md +257 -0
  81. package/content/skills/areas/explainability.md +174 -0
  82. package/content/skills/areas/fallback-patterns.md +200 -0
  83. package/content/skills/areas/human-oversight.md +220 -0
  84. package/content/skills/areas/input-validation.md +380 -0
  85. package/content/skills/areas/monitoring.md +207 -0
  86. package/content/skills/areas/output-sanitization.md +183 -0
  87. package/content/skills/areas/pii-handling.md +189 -0
  88. package/content/skills/areas/prompt-security.md +153 -0
  89. package/content/skills/areas/rag-security.md +230 -0
  90. package/content/skills/areas/rate-limiting.md +246 -0
  91. package/content/skills/areas/supply-chain.md +193 -0
  92. package/content/skills/core.md +62 -0
  93. package/content/skills/infrastructure/logging.md +202 -0
  94. package/content/skills/infrastructure/rate-limiting.md +169 -0
  95. package/content/skills/infrastructure/secrets.md +167 -0
  96. package/content/skills/workflows/fastapi-llm.md +86 -0
  97. package/docs/resolvers.md +114 -0
  98. package/lib/auto-verify.js +378 -0
  99. package/lib/build.js +629 -0
  100. package/lib/checksum.js +39 -0
  101. package/lib/fetch.js +164 -9
  102. package/lib/init.js +141 -93
  103. package/lib/keywords.js +92 -130
  104. package/lib/special-recognizers.js +370 -0
  105. package/package.json +6 -2
  106. package/scripts/baseline-cursorrules.snapshot.txt +30 -0
  107. package/scripts/bootstrap-step-6-bench.js +85 -0
  108. package/scripts/check-content-sync.js +91 -0
  109. package/scripts/triggers.schema.json +50 -0
  110. package/scripts/validate-triggers.js +176 -0
  111. package/content/implement/fallback-patterns.md +0 -190
  112. package/content/implement/input-validation.md +0 -212
  113. package/content/implement/pii-handling.md +0 -207
  114. package/content/implement/rate-limiting.md +0 -217
  115. /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/bias-monitoring.md +0 -0
  116. /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/confidence-scoring.md +0 -0
  117. /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/data-integrity.md +0 -0
  118. /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/explainability.md +0 -0
  119. /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/human-oversight.md +0 -0
  120. /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/monitoring.md +0 -0
  121. /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/output-sanitization.md +0 -0
  122. /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/prompt-security.md +0 -0
  123. /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/rag-security.md +0 -0
  124. /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/supply-chain.md +0 -0
@@ -0,0 +1,53 @@
1
+ # Contributing to Aigis
2
+
3
+ Thanks for your interest in contributing. This guide is short on purpose — most contributions follow one of a few well-trodden paths.
4
+
5
+ ## Where to put what
6
+
7
+ - **Governance pattern content** (the procedures agents follow): `content/skills/areas/<id>.md`
8
+ - **Workflow scaffolding** (canonical file layouts per project type): `content/skills/workflows/<type>.md`
9
+ - **Trigger mappings** (natural-language → trait): `content/resolvers/triggers.json` — see [Trigger mappings](#trigger-mappings) below.
10
+ - **Verification checklists** (used by `aigis verify`): `content/verify/checklist-<id>.md`
11
+ - **Auto-verify rules** (deterministic scanner patterns): `content/index/auto-verify-rules.json`
12
+ - **CLI behavior**: `bin/aigis.js` and `lib/*.js`
13
+
14
+ ## Trigger mappings
15
+
16
+ To add or modify entries in `content/resolvers/triggers.json`:
17
+
18
+ 1. Read [`docs/resolvers.md`](docs/resolvers.md) — the tier rule and curation policy.
19
+ 2. Pick a tier per the decision rule. When in doubt, low-confidence.
20
+ 3. Insert the entry alphabetically within the appropriate tier (case-insensitive sort).
21
+ 4. Run validation locally: `node scripts/validate-triggers.js`
22
+ 5. Open a PR using `.github/PULL_REQUEST_TEMPLATE/trigger_mapping.md`.
23
+
24
+ **The use-case requirement is non-negotiable.** Every trigger PR includes a one-sentence real use case (`"I'm building X and I needed this trigger because Y."`). PRs without a real use case are closed. We curate based on actual demand, not theoretical taxonomy completeness.
25
+
26
+ The PR template enforces structure; CI runs four validations on the JSON via `.github/workflows/triggers-validation.yml`.
27
+
28
+ ## CLI / library changes
29
+
30
+ - Add CLI-deterministic tests next to the change. Where existing tests exist (e.g., `test/checksum-determinism.test.js`), follow their pattern.
31
+ - Backward compatibility: not promised across alpha releases. After v2.0 final ships, breaking changes go through a deprecation notice and a major version bump.
32
+ - Python CLI mirrors the JS CLI structurally (see `cli-python/aigis_cli/`). Functional parity is best-effort; JS is the primary runtime for the v2.0 benchmark.
33
+
34
+ ## Running aigis from this checkout
35
+
36
+ ```
37
+ git clone <repo>
38
+ cd aigis-cli
39
+ npm install
40
+ npm link # makes the in-repo build the global `aigis`
41
+ aigis --version # confirms you're on the branch's version
42
+ ```
43
+
44
+ To restore the published version: `npm unlink -g @aigis-ai/cli && npm install -g @aigis-ai/cli`.
45
+
46
+ ## Tests
47
+
48
+ ```
49
+ node scripts/validate-triggers.js # JSON validation (schema, traits, prompts, ordering)
50
+ node test/checksum-determinism.test.js # checksum reproducibility
51
+ ```
52
+
53
+ (Test runner is the standard Node test runner via the `test:` script in `package.json`. We do not use a heavyweight test framework.)
package/SKILL.md CHANGED
@@ -1,70 +1,35 @@
1
1
  ---
2
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.
3
+ description: AI governance for coding agents. Three-layer skill system — core / area / workflow. Use the aigis CLI to load skills on demand. Mapped to NIST AI RMF, OWASP Top 10 for LLMs, and ISO/IEC 42001.
4
4
  ---
5
5
 
6
- # Aigis — AI Governance Skill
6
+ # Aigis skill system
7
7
 
8
- Use the aigis CLI for governance patterns when building or auditing AI/LLM features.
8
+ Aigis ships skills in three layers. Agents load them on demand via the CLI, not by reading this file.
9
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>
10
+ ## Layers
20
11
 
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.
12
+ - **Core skill** — `content/skills/core.md`. Always loaded into the agent's context by `aigis init <ide>`. Orients the agent to the workflow + the four CLI commands. ~50 lines.
13
+ - **Area skills** — `content/skills/areas/<id>.md`, one per governance area (input-validation, pii-handling, etc.). 15 today. Loaded by `aigis get <id>` when classify points the agent at that area.
14
+ - **Workflow skills** — `content/skills/workflows/<type>.md`. Loaded by `aigis workflow <type>` after classify identifies the project shape. Step 5 ships `fastapi-llm`; future workflows: `express-llm`, `nextjs-llm`, `agentic`, `rag-service`.
22
15
 
23
- ## Quick start — audit existing project
24
- \`\`\`bash
25
- # 1. Get the structured audit scan prompt
26
- aigis audit --scan
16
+ ## How an agent uses Aigis
27
17
 
28
- # 2. Follow the scan instructions: inventory the project, detect traits, classify
18
+ After `aigis init` writes the core skill into the agent's rules file, the agent runs:
29
19
 
30
- # 3. Run the full audit with detected traits
31
- aigis audit --traits uses-llm,processes-pii,is-external
20
+ 1. `aigis classify` — get risk tier + recommended areas + workflow suggestion
21
+ 2. `aigis workflow <type>` — get the canonical file layout + wiring contracts
22
+ 3. `aigis get <area>` and `aigis verify <area> --auto .` per area, in order
32
23
 
33
- # 4. Evaluate existing code against each check, produce gap report
34
- \`\`\`
24
+ See `content/skills/core.md` for the full prose version that the agent sees.
35
25
 
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
26
+ ## Setup per IDE
42
27
 
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
28
+ Run once in the project root:
57
29
 
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
30
+ - `aigis init cursor` — writes `.cursorrules`
31
+ - `aigis init claude-code` — writes `~/.claude/skills/aigis/SKILL.md`
32
+ - `aigis init windsurf` — writes `.windsurfrules`
33
+ - `aigis init copilot` — writes `.github/copilot-instructions.md`
64
34
 
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
35
+ All four destinations receive the same content: `content/skills/core.md`. Area and workflow skills load on demand; they are not pre-installed into the rules file.