@aigis-ai/cli 1.0.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/LICENSE +21 -0
- package/README.md +204 -0
- package/SKILL.md +74 -0
- package/bin/aigis.js +337 -0
- package/content/implement/audit-logging.md +171 -0
- package/content/implement/bias-monitoring.md +172 -0
- package/content/implement/confidence-scoring.md +180 -0
- package/content/implement/data-integrity.md +257 -0
- package/content/implement/explainability.md +174 -0
- package/content/implement/fallback-patterns.md +190 -0
- package/content/implement/human-oversight.md +220 -0
- package/content/implement/input-validation.md +212 -0
- package/content/implement/monitoring.md +207 -0
- package/content/implement/output-sanitization.md +183 -0
- package/content/implement/pii-handling.md +207 -0
- package/content/implement/prompt-security.md +153 -0
- package/content/implement/rag-security.md +230 -0
- package/content/implement/rate-limiting.md +217 -0
- package/content/implement/supply-chain.md +193 -0
- package/content/index/audit-scan.md +403 -0
- package/content/index/frameworks.md +82 -0
- package/content/index/guardrails.json +23 -0
- package/content/index/taxonomy.md +81 -0
- package/content/templates/ai-impact-assessment.md +54 -0
- package/content/templates/intended-purpose-doc.md +39 -0
- package/content/templates/risk-characterization.md +34 -0
- package/content/templates/third-party-assessment.md +41 -0
- package/content/verify/checklist-audit-logging.md +13 -0
- package/content/verify/checklist-bias-monitoring.md +13 -0
- package/content/verify/checklist-confidence-scoring.md +13 -0
- package/content/verify/checklist-data-integrity.md +12 -0
- package/content/verify/checklist-explainability.md +13 -0
- package/content/verify/checklist-fallback-patterns.md +13 -0
- package/content/verify/checklist-human-oversight.md +14 -0
- package/content/verify/checklist-input-validation.md +16 -0
- package/content/verify/checklist-monitoring.md +13 -0
- package/content/verify/checklist-output-sanitization.md +14 -0
- package/content/verify/checklist-pii-handling.md +14 -0
- package/content/verify/checklist-prompt-security.md +13 -0
- package/content/verify/checklist-rag-security.md +12 -0
- package/content/verify/checklist-rate-limiting.md +13 -0
- package/content/verify/checklist-supply-chain.md +13 -0
- package/lib/annotate.js +53 -0
- package/lib/classify.js +185 -0
- package/lib/fetch.js +112 -0
- package/lib/init.js +122 -0
- package/lib/keywords.js +139 -0
- package/lib/search.js +76 -0
- package/package.json +35 -0
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: audit-scan
|
|
3
|
+
title: Aigis codebase audit scan prompt
|
|
4
|
+
version: "1.1"
|
|
5
|
+
purpose: Structured instructions for an agent to scan an existing codebase, detect system traits, identify governance gaps, and produce a compliance report
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# AIGIS CODEBASE AUDIT
|
|
9
|
+
|
|
10
|
+
Follow these instructions exactly. Complete every section. Do not skip any check.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## PHASE 1: PROJECT INVENTORY
|
|
15
|
+
|
|
16
|
+
Before analyzing governance, build a complete picture of what exists.
|
|
17
|
+
|
|
18
|
+
### 1.1 File discovery
|
|
19
|
+
|
|
20
|
+
Scan the project and document:
|
|
21
|
+
|
|
22
|
+
- [ ] **Primary language(s):** (Python, JavaScript/TypeScript, Go, Java, etc.)
|
|
23
|
+
- [ ] **Package manager files:** (requirements.txt, package.json, pyproject.toml, go.mod, pom.xml)
|
|
24
|
+
- [ ] **Environment/config files:** (.env, .env.example, config.yaml, settings.py, etc.)
|
|
25
|
+
- [ ] **API route definitions:** (FastAPI routes, Express routes, Flask blueprints, etc.)
|
|
26
|
+
- [ ] **Test files:** (test directories, test files, testing frameworks used)
|
|
27
|
+
- [ ] **Deployment files:** (Dockerfile, docker-compose, kubernetes manifests, CI/CD configs)
|
|
28
|
+
- [ ] **Documentation:** (README, docs/, API specs, architecture docs)
|
|
29
|
+
|
|
30
|
+
### 1.2 Dependency analysis
|
|
31
|
+
|
|
32
|
+
Read the dependency files and list:
|
|
33
|
+
|
|
34
|
+
- [ ] **LLM client libraries:** (openai, anthropic, cohere, google-generativeai, langchain, llama-index, transformers, vllm, ollama)
|
|
35
|
+
- [ ] **Vector database clients:** (pinecone-client, chromadb, weaviate-client, qdrant-client, pgvector, faiss, milvus)
|
|
36
|
+
- [ ] **Embedding libraries:** (sentence-transformers, openai embeddings, cohere embed)
|
|
37
|
+
- [ ] **ML/AI frameworks:** (tensorflow, pytorch, scikit-learn, huggingface)
|
|
38
|
+
- [ ] **Web frameworks:** (fastapi, flask, django, express, next.js, nestjs)
|
|
39
|
+
- [ ] **Database clients:** (sqlalchemy, prisma, mongoose, knex, sequelize)
|
|
40
|
+
- [ ] **Authentication libraries:** (jwt, oauth, passport, auth0, clerk)
|
|
41
|
+
- [ ] **Monitoring/logging libraries:** (winston, pino, structlog, loguru, sentry, datadog)
|
|
42
|
+
- [ ] **Data validation libraries:** (pydantic, zod, joi, ajv, marshmallow)
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## PHASE 2: TRAIT DETECTION
|
|
47
|
+
|
|
48
|
+
For each trait below, search the codebase for the specified indicators. Mark YES, NO, or UNCERTAIN. If UNCERTAIN, explain what you found and why you're unsure.
|
|
49
|
+
|
|
50
|
+
### 2.1 AI architecture traits
|
|
51
|
+
|
|
52
|
+
**uses-llm**
|
|
53
|
+
Search for: imports of openai, anthropic, cohere, google.generativeai, langchain.llms, langchain.chat_models, llama_index, transformers pipeline, any chat.completions.create or messages API calls, any prompt template construction
|
|
54
|
+
- [ ] YES / NO / UNCERTAIN
|
|
55
|
+
- Evidence: [file:line references]
|
|
56
|
+
|
|
57
|
+
**uses-rag**
|
|
58
|
+
Search for: imports of vector database clients (pinecone, chromadb, weaviate, qdrant, pgvector), embedding generation calls, similarity_search or .query() on vector stores, any retrieval chain or retrieval QA construction, documents being chunked and embedded
|
|
59
|
+
- [ ] YES / NO / UNCERTAIN
|
|
60
|
+
- Evidence: [file:line references]
|
|
61
|
+
|
|
62
|
+
**uses-finetuned**
|
|
63
|
+
Search for: training scripts, fine-tuning code (LoRA, QLoRA, PEFT, SFT), custom model loading from local paths or HuggingFace hub with custom model IDs, dataset preparation for training, training configuration files, model checkpoints in the repo
|
|
64
|
+
- [ ] YES / NO / UNCERTAIN
|
|
65
|
+
- Evidence: [file:line references]
|
|
66
|
+
|
|
67
|
+
**uses-thirdparty-api**
|
|
68
|
+
Search for: API keys for model providers (OPENAI_API_KEY, ANTHROPIC_API_KEY, COHERE_API_KEY, etc.) in env files or config, base_url pointing to external providers, client initialization with API keys, any network calls to model inference endpoints
|
|
69
|
+
- [ ] YES / NO / UNCERTAIN
|
|
70
|
+
- Evidence: [file:line references]
|
|
71
|
+
|
|
72
|
+
**is-agentic**
|
|
73
|
+
Search for: tool/function definitions for LLM use (tools=[], functions=[], @tool decorator), LLM output being used to trigger actions (database writes, API calls, file operations, email sending), agent frameworks (langchain agents, autogen, crewai), code execution from LLM output, any loop where LLM decides the next action
|
|
74
|
+
- [ ] YES / NO / UNCERTAIN
|
|
75
|
+
- Evidence: [file:line references]
|
|
76
|
+
|
|
77
|
+
**is-multimodal**
|
|
78
|
+
Search for: image processing with LLMs (vision API calls, image_url in messages), audio transcription (whisper, speech-to-text), text-to-speech, image generation (DALL-E, Stable Diffusion), video processing, document OCR with AI
|
|
79
|
+
- [ ] YES / NO / UNCERTAIN
|
|
80
|
+
- Evidence: [file:line references]
|
|
81
|
+
|
|
82
|
+
### 2.2 Data sensitivity traits
|
|
83
|
+
|
|
84
|
+
**processes-pii**
|
|
85
|
+
Search for: fields or variables named email, phone, ssn, address, name, date_of_birth, social_security, passport, driver_license; user profile or account models with personal fields; form inputs collecting personal data; database tables storing personal information; any data that could identify a specific individual
|
|
86
|
+
- [ ] YES / NO / UNCERTAIN
|
|
87
|
+
- Evidence: [file:line references]
|
|
88
|
+
|
|
89
|
+
**handles-financial**
|
|
90
|
+
Search for: fields named account_number, credit_card, transaction, balance, payment, invoice, claim, policy_number, premium; financial calculation logic; payment processing integrations (stripe, square, plaid); insurance-related models; credit scoring; loan or lending logic
|
|
91
|
+
- [ ] YES / NO / UNCERTAIN
|
|
92
|
+
- Evidence: [file:line references]
|
|
93
|
+
|
|
94
|
+
**handles-health**
|
|
95
|
+
Search for: fields named diagnosis, prescription, patient, medical_record, health_record, condition, symptom, treatment, ICD_code, CPT_code; HIPAA-related configuration; health data models; medical terminology in schemas; clinical data processing
|
|
96
|
+
- [ ] YES / NO / UNCERTAIN
|
|
97
|
+
- Evidence: [file:line references]
|
|
98
|
+
|
|
99
|
+
**handles-proprietary**
|
|
100
|
+
Search for: trade secret markers, confidential labels in code or data, proprietary algorithm implementations, competitive intelligence processing, internal strategy documents being processed, source code analysis features, IP-related data handling
|
|
101
|
+
- [ ] YES / NO / UNCERTAIN
|
|
102
|
+
- Evidence: [file:line references]
|
|
103
|
+
|
|
104
|
+
**handles-minors**
|
|
105
|
+
Search for: age verification logic, date_of_birth fields with age checks, COPPA compliance references, parental consent flows, fields or models related to students/children/minors, age-gating logic, under-13 or under-16 checks
|
|
106
|
+
- [ ] YES / NO / UNCERTAIN
|
|
107
|
+
- Evidence: [file:line references]
|
|
108
|
+
|
|
109
|
+
### 2.3 Impact scope traits
|
|
110
|
+
|
|
111
|
+
**influences-decisions**
|
|
112
|
+
Search for: AI output being used to approve/deny/score/rank/filter people; hiring or recruitment logic; credit or loan decisions; insurance claim assessment; content moderation decisions affecting users; grading or evaluation; benefit eligibility determination; any place where AI output directly affects a specific person's outcome
|
|
113
|
+
- [ ] YES / NO / UNCERTAIN
|
|
114
|
+
- Evidence: [file:line references]
|
|
115
|
+
|
|
116
|
+
**accepts-user-input**
|
|
117
|
+
Search for: API endpoints accepting text body/payload from users, chat input fields, form text areas, file upload endpoints where content is sent to LLM, any route where user-provided text is concatenated into or passed alongside LLM prompts
|
|
118
|
+
- [ ] YES / NO / UNCERTAIN
|
|
119
|
+
- Evidence: [file:line references]
|
|
120
|
+
|
|
121
|
+
**is-external**
|
|
122
|
+
Search for: public API endpoints (no auth required, or auth for external users), customer-facing UI, public documentation referencing the AI feature, deployment configs exposing to internet, CORS configs allowing external origins, public-facing domains in config
|
|
123
|
+
- [ ] YES / NO / UNCERTAIN
|
|
124
|
+
- Evidence: [file:line references]
|
|
125
|
+
|
|
126
|
+
**is-internal**
|
|
127
|
+
Search for: VPN-only access configs, internal domain restrictions, employee-only auth (SSO, corporate identity), admin-only UI, deployment to internal infrastructure only
|
|
128
|
+
- [ ] YES / NO / UNCERTAIN
|
|
129
|
+
- Evidence: [file:line references]
|
|
130
|
+
|
|
131
|
+
**is-high-volume**
|
|
132
|
+
Search for: auto-scaling configs, load balancer references, queue/worker patterns for LLM calls, batch processing of LLM requests, rate limiting configuration suggesting high throughput, production deployment manifests with multiple replicas, usage metrics suggesting >1000 requests/day
|
|
133
|
+
- [ ] YES / NO / UNCERTAIN
|
|
134
|
+
- Evidence: [file:line references]
|
|
135
|
+
|
|
136
|
+
### 2.4 Output type traits
|
|
137
|
+
|
|
138
|
+
**generates-code**
|
|
139
|
+
Search for: LLM output being passed to eval(), exec(), subprocess, child_process, vm.runInContext, or any code execution; SQL generation from LLM output; code generation features; LLM-generated scripts being saved and run; any sandbox or code execution environment
|
|
140
|
+
- [ ] YES / NO / UNCERTAIN
|
|
141
|
+
- Evidence: [file:line references]
|
|
142
|
+
|
|
143
|
+
**generates-content**
|
|
144
|
+
Search for: LLM output being published to websites, sent as emails to customers, posted to social media, included in reports distributed externally, used in marketing materials, displayed in customer-facing UI without human review step
|
|
145
|
+
- [ ] YES / NO / UNCERTAIN
|
|
146
|
+
- Evidence: [file:line references]
|
|
147
|
+
|
|
148
|
+
**multi-model-pipeline**
|
|
149
|
+
Search for: multiple different LLM calls in sequence where one model's output feeds into another's input, chain/pipeline constructions (langchain chains, sequential calls), orchestration logic connecting multiple AI models, ensemble or voting patterns across models
|
|
150
|
+
- [ ] YES / NO / UNCERTAIN
|
|
151
|
+
- Evidence: [file:line references]
|
|
152
|
+
|
|
153
|
+
### 2.5 Regulatory jurisdiction traits
|
|
154
|
+
|
|
155
|
+
**jurisdiction-eu**
|
|
156
|
+
Search for: EU-specific configuration, GDPR references, EU AI Act references, .eu domains, European language localizations, EU data residency settings, European cloud regions in deployment configs, EU-specific compliance documentation
|
|
157
|
+
- [ ] YES / NO / UNCERTAIN
|
|
158
|
+
- Evidence: [file:line references]
|
|
159
|
+
|
|
160
|
+
**jurisdiction-us-regulated**
|
|
161
|
+
Search for: HIPAA references or BAA documentation, FCRA or fair lending references, FERPA references, FedRAMP configuration, SOC2 documentation, US financial regulation references (OCC, CFPB, SEC), state-specific AI regulation references
|
|
162
|
+
- [ ] YES / NO / UNCERTAIN
|
|
163
|
+
- Evidence: [file:line references]
|
|
164
|
+
|
|
165
|
+
**jurisdiction-global**
|
|
166
|
+
Search for: multi-region deployment configs, internationalization (i18n) with multiple country locales, multiple currency support, geo-routing logic, data residency for multiple countries, multi-language support spanning different regulatory zones
|
|
167
|
+
- [ ] YES / NO / UNCERTAIN
|
|
168
|
+
- Evidence: [file:line references]
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## PHASE 3: TRAIT SUMMARY
|
|
173
|
+
|
|
174
|
+
Based on Phase 2, compile the detected traits:
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
Detected traits: [comma-separated list of YES traits]
|
|
178
|
+
Uncertain traits: [comma-separated list of UNCERTAIN traits with brief reason]
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Run: `aigis classify --traits <detected-traits> --json`
|
|
182
|
+
|
|
183
|
+
Record the output:
|
|
184
|
+
- Risk tier: ___
|
|
185
|
+
- Implement files recommended: ___
|
|
186
|
+
- Templates required: ___
|
|
187
|
+
- Guardrails fired: ___
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## PHASE 4: EXISTING CONTROLS ASSESSMENT
|
|
192
|
+
|
|
193
|
+
For each implement file recommended by the classification, check whether the patterns are ALREADY implemented in the codebase. This is the gap analysis.
|
|
194
|
+
|
|
195
|
+
### 4.1 Input validation (if recommended)
|
|
196
|
+
|
|
197
|
+
| # | Control | What to look for in the code | Status | Evidence |
|
|
198
|
+
|---|---------|------------------------------|--------|----------|
|
|
199
|
+
| V1 | Input length check | A function or middleware that checks character count or token count of user input BEFORE it reaches the LLM call | PASS / FAIL / PARTIAL | [file:line or "not found"] |
|
|
200
|
+
| V2 | System/user prompt separation | LLM calls using structured messages array with role: "system" and role: "user" as separate objects, NOT string concatenation | PASS / FAIL / PARTIAL | [file:line] |
|
|
201
|
+
| V3 | Character sanitization | A function stripping control characters, null bytes, zero-width Unicode from user input before LLM processing | PASS / FAIL / PARTIAL | [file:line] |
|
|
202
|
+
| V4 | Output schema validation | LLM response being parsed and validated against a defined schema (pydantic, zod, ajv, JSON schema) before downstream use | PASS / FAIL / PARTIAL | [file:line] |
|
|
203
|
+
| V5 | Injection pattern detection | Any pattern matching or classification of user input for known injection phrases, even if just logging | PASS / FAIL / PARTIAL | [file:line] |
|
|
204
|
+
|
|
205
|
+
### 4.2 Output sanitization (if recommended)
|
|
206
|
+
|
|
207
|
+
| # | Control | What to look for | Status | Evidence |
|
|
208
|
+
|---|---------|------------------|--------|----------|
|
|
209
|
+
| V1 | HTML encoding of LLM output | LLM output being escaped/encoded before rendering in any web context | PASS / FAIL / PARTIAL | |
|
|
210
|
+
| V2 | Parameterized DB queries | Any database operations using LLM output use parameterized queries, not string interpolation | PASS / FAIL / PARTIAL | |
|
|
211
|
+
| V3 | Code execution sandboxing | If LLM generates code that is executed, it runs in a sandbox (subprocess, vm, container) not eval/exec | PASS / FAIL / PARTIAL | |
|
|
212
|
+
| V4 | Content type validation | LLM response content type is checked before use (is it valid JSON? is it a number? is it within allowed enum?) | PASS / FAIL / PARTIAL | |
|
|
213
|
+
|
|
214
|
+
### 4.3 PII handling (if recommended)
|
|
215
|
+
|
|
216
|
+
| # | Control | What to look for | Status | Evidence |
|
|
217
|
+
|---|---------|------------------|--------|----------|
|
|
218
|
+
| V1 | PII redaction before LLM | A function detecting and replacing PII (regex, NER model, or library) that runs BEFORE user data is sent to the LLM | PASS / FAIL / PARTIAL | |
|
|
219
|
+
| V2 | Data minimization | Only specific needed fields are extracted and sent to the LLM, not entire database records or user profiles | PASS / FAIL / PARTIAL | |
|
|
220
|
+
| V3 | Output PII filtering | LLM response is scanned for PII before being returned to the user or stored | PASS / FAIL / PARTIAL | |
|
|
221
|
+
| V4 | Separated data stores | PII is stored in a different location or with different access controls than the data the LLM can access | PASS / FAIL / PARTIAL | |
|
|
222
|
+
| V5 | Redacted logging | Log entries containing LLM inputs/outputs have PII redacted or hashed, not stored in plaintext | PASS / FAIL / PARTIAL | |
|
|
223
|
+
|
|
224
|
+
### 4.4 Prompt security (if recommended)
|
|
225
|
+
|
|
226
|
+
| # | Control | What to look for | Status | Evidence |
|
|
227
|
+
|---|---------|------------------|--------|----------|
|
|
228
|
+
| V1 | No secrets in prompts | System prompts do not contain API keys, passwords, database credentials, or tokens | PASS / FAIL / PARTIAL | |
|
|
229
|
+
| V2 | Minimal prompt content | System prompts contain behavioral instructions only, not detailed business logic, pricing, or internal processes | PASS / FAIL / PARTIAL | |
|
|
230
|
+
| V3 | Leakage detection | There is some check on LLM output for system prompt content echoing back | PASS / FAIL / PARTIAL | |
|
|
231
|
+
| V4 | Server-side rule enforcement | Business rules (output length, topic restrictions, format requirements) are enforced in code, not just in the prompt | PASS / FAIL / PARTIAL | |
|
|
232
|
+
|
|
233
|
+
### 4.5 Human oversight (if recommended)
|
|
234
|
+
|
|
235
|
+
| # | Control | What to look for | Status | Evidence |
|
|
236
|
+
|---|---------|------------------|--------|----------|
|
|
237
|
+
| V1 | Tool allowlist | If LLM has tools/functions, they are defined as an explicit list (not dynamically generated or unrestricted) | PASS / FAIL / PARTIAL | |
|
|
238
|
+
| V2 | Write operation approval | Database writes, API calls, emails, or other state-changing actions triggered by LLM require human confirmation or are logged with review capability | PASS / FAIL / PARTIAL | |
|
|
239
|
+
| V3 | Action rate limiting | There are limits on how many actions the LLM can take per time window | PASS / FAIL / PARTIAL | |
|
|
240
|
+
| V4 | Override mechanism | API responses or UI include a way for humans to override or escalate AI decisions | PASS / FAIL / PARTIAL | |
|
|
241
|
+
| V5 | Confidence gating | Low-confidence outputs are flagged or routed to human review rather than auto-processed | PASS / FAIL / PARTIAL | |
|
|
242
|
+
|
|
243
|
+
### 4.6 Supply chain (if recommended)
|
|
244
|
+
|
|
245
|
+
| # | Control | What to look for | Status | Evidence |
|
|
246
|
+
|---|---------|------------------|--------|----------|
|
|
247
|
+
| V1 | Model version pinning | LLM API calls specify an exact model version (e.g., "gpt-4o-2024-11-20") not a floating alias (e.g., "gpt-4o") | PASS / FAIL / PARTIAL | |
|
|
248
|
+
| V2 | Version tracking in logs | Model version is recorded in logs or response metadata for every LLM call | PASS / FAIL / PARTIAL | |
|
|
249
|
+
| V3 | Regression test suite | There are tests that evaluate LLM output quality that could be run against a new model version | PASS / FAIL / PARTIAL | |
|
|
250
|
+
| V4 | Fallback provider | There is a secondary LLM provider or fallback behavior defined for when the primary provider fails | PASS / FAIL / PARTIAL | |
|
|
251
|
+
|
|
252
|
+
### 4.7 Data integrity (if recommended)
|
|
253
|
+
|
|
254
|
+
| # | Control | What to look for | Status | Evidence |
|
|
255
|
+
|---|---------|------------------|--------|----------|
|
|
256
|
+
| V1 | Data provenance tracking | Documents or data entering the system have their source, ingestion time, and checksums recorded | PASS / FAIL / PARTIAL | |
|
|
257
|
+
| V2 | Pre-embedding validation | Data is validated (source check, content check, freshness check) before being embedded into a vector store | PASS / FAIL / PARTIAL | |
|
|
258
|
+
| V3 | Training data versioning | Fine-tuning or training datasets are versioned and checksummed | PASS / FAIL / PARTIAL | |
|
|
259
|
+
| V4 | Distribution monitoring | There is monitoring for changes in embedding or output distributions after data updates | PASS / FAIL / PARTIAL | |
|
|
260
|
+
| V5 | Batch rollback capability | There is a mechanism to roll back a batch of ingested data if it's found to be compromised | PASS / FAIL / PARTIAL | |
|
|
261
|
+
|
|
262
|
+
### 4.8 RAG security (if recommended)
|
|
263
|
+
|
|
264
|
+
| # | Control | What to look for | Status | Evidence |
|
|
265
|
+
|---|---------|------------------|--------|----------|
|
|
266
|
+
| V1 | Vector DB access control | Vector database queries include access control filters (department, role, classification level) | PASS / FAIL / PARTIAL | |
|
|
267
|
+
| V2 | Tenant isolation | In multi-tenant systems, vector queries always filter by tenant ID | PASS / FAIL / PARTIAL | |
|
|
268
|
+
| V3 | Retrieved content validation | Retrieved results are filtered by relevance score threshold and checked for suspicious content | PASS / FAIL / PARTIAL | |
|
|
269
|
+
| V4 | Embedding endpoint protection | The embedding generation endpoint has authentication and rate limiting | PASS / FAIL / PARTIAL | |
|
|
270
|
+
| V5 | Permission inheritance | Embeddings carry the access permissions of their source documents | PASS / FAIL / PARTIAL | |
|
|
271
|
+
|
|
272
|
+
### 4.9 Confidence scoring (if recommended)
|
|
273
|
+
|
|
274
|
+
| # | Control | What to look for | Status | Evidence |
|
|
275
|
+
|---|---------|------------------|--------|----------|
|
|
276
|
+
| V1 | Confidence metadata | AI responses include a confidence score or level (high/medium/low) in the output | PASS / FAIL / PARTIAL | |
|
|
277
|
+
| V2 | Grounding verification | For RAG systems, there is a check that LLM claims are supported by retrieved sources | PASS / FAIL / PARTIAL | |
|
|
278
|
+
| V3 | Recommendation framing | AI output is presented as a suggestion/recommendation, not as a definitive fact, in any user-facing display | PASS / FAIL / PARTIAL | |
|
|
279
|
+
| V4 | Source attribution | When RAG is used, the response includes references to the source documents | PASS / FAIL / PARTIAL | |
|
|
280
|
+
|
|
281
|
+
### 4.10 Rate limiting (if recommended)
|
|
282
|
+
|
|
283
|
+
| # | Control | What to look for | Status | Evidence |
|
|
284
|
+
|---|---------|------------------|--------|----------|
|
|
285
|
+
| V1 | Per-user rate limits | LLM endpoints have rate limiting per user or per API key | PASS / FAIL / PARTIAL | |
|
|
286
|
+
| V2 | Token budget | There are daily or per-request token limits configured | PASS / FAIL / PARTIAL | |
|
|
287
|
+
| V3 | Cost monitoring | There is monitoring or alerting on LLM API costs | PASS / FAIL / PARTIAL | |
|
|
288
|
+
| V4 | Request timeout | LLM calls have a timeout configured | PASS / FAIL / PARTIAL | |
|
|
289
|
+
|
|
290
|
+
### 4.11 Audit logging (if recommended)
|
|
291
|
+
|
|
292
|
+
| # | Control | What to look for | Status | Evidence |
|
|
293
|
+
|---|---------|------------------|--------|----------|
|
|
294
|
+
| V1 | Structured log entries | Every LLM interaction produces a structured log with trace ID, timestamp, model version, token counts | PASS / FAIL / PARTIAL | |
|
|
295
|
+
| V2 | Trace ID propagation | A trace/correlation ID is generated per request and passed through all components | PASS / FAIL / PARTIAL | |
|
|
296
|
+
| V3 | Decision logging | AI-influenced decisions are logged with the decision, confidence, and context | PASS / FAIL / PARTIAL | |
|
|
297
|
+
| V4 | No raw PII in logs | Log entries do not contain unredacted personal information | PASS / FAIL / PARTIAL | |
|
|
298
|
+
|
|
299
|
+
### 4.12 Bias monitoring (if recommended)
|
|
300
|
+
|
|
301
|
+
| # | Control | What to look for | Status | Evidence |
|
|
302
|
+
|---|---------|------------------|--------|----------|
|
|
303
|
+
| V1 | Fairness metadata in logs | Logs include fields that enable fairness analysis (claim type, region, channel, input language) without collecting protected characteristics directly | PASS / FAIL / PARTIAL | |
|
|
304
|
+
| V2 | Distribution monitoring | There is analysis or dashboarding of output distributions across different segments | PASS / FAIL / PARTIAL | |
|
|
305
|
+
| V3 | Periodic fairness reporting | There is a scheduled process or script that generates fairness reports | PASS / FAIL / PARTIAL | |
|
|
306
|
+
| V4 | Override pattern analysis | Human override rates are tracked and analyzed for patterns across segments | PASS / FAIL / PARTIAL | |
|
|
307
|
+
|
|
308
|
+
### 4.13 Fallback patterns (if recommended)
|
|
309
|
+
|
|
310
|
+
| # | Control | What to look for | Status | Evidence |
|
|
311
|
+
|---|---------|------------------|--------|----------|
|
|
312
|
+
| V1 | Default safe response | There is a defined fallback response returned when the LLM fails or returns invalid output | PASS / FAIL / PARTIAL | |
|
|
313
|
+
| V2 | Circuit breaker | There is a circuit breaker that stops calling the LLM after repeated failures | PASS / FAIL / PARTIAL | |
|
|
314
|
+
| V3 | Kill switch | There is a mechanism to disable the AI system without deploying new code (feature flag, config toggle, environment variable) | PASS / FAIL / PARTIAL | |
|
|
315
|
+
| V4 | Exception handling | All LLM calls are wrapped in try/catch with defined fallback behavior (no unhandled crashes) | PASS / FAIL / PARTIAL | |
|
|
316
|
+
|
|
317
|
+
### 4.14 Monitoring (if recommended)
|
|
318
|
+
|
|
319
|
+
| # | Control | What to look for | Status | Evidence |
|
|
320
|
+
|---|---------|------------------|--------|----------|
|
|
321
|
+
| V1 | Key metrics tracking | Latency, error rate, token usage, and/or cost are being tracked via monitoring tools or custom dashboards | PASS / FAIL / PARTIAL | |
|
|
322
|
+
| V2 | Drift detection | There is comparison of recent output distributions against a baseline | PASS / FAIL / PARTIAL | |
|
|
323
|
+
| V3 | User feedback mechanism | Users can flag bad AI outputs (thumbs down, disagree button, feedback form) | PASS / FAIL / PARTIAL | |
|
|
324
|
+
| V4 | Incident logging | There is a structured process for logging and tracking AI-related incidents | PASS / FAIL / PARTIAL | |
|
|
325
|
+
|
|
326
|
+
### 4.15 Explainability (if recommended)
|
|
327
|
+
|
|
328
|
+
| # | Control | What to look for | Status | Evidence |
|
|
329
|
+
|---|---------|------------------|--------|----------|
|
|
330
|
+
| V1 | Decision explanations | The system generates human-readable explanations for its AI-driven outputs | PASS / FAIL / PARTIAL | |
|
|
331
|
+
| V2 | Model card | There is documentation describing the model's purpose, limitations, and performance characteristics | PASS / FAIL / PARTIAL | |
|
|
332
|
+
| V3 | Audit-friendly records | Decisions are stored in a format suitable for compliance review with full context | PASS / FAIL / PARTIAL | |
|
|
333
|
+
| V4 | Appeal mechanism | Users or affected individuals have a way to appeal or request review of AI decisions | PASS / FAIL / PARTIAL | |
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## PHASE 5: GAP REPORT
|
|
338
|
+
|
|
339
|
+
Compile the results into a structured report:
|
|
340
|
+
|
|
341
|
+
### 5.1 Summary
|
|
342
|
+
|
|
343
|
+
```
|
|
344
|
+
Project: [project name]
|
|
345
|
+
Scan date: [date]
|
|
346
|
+
Risk tier: [from Phase 3]
|
|
347
|
+
Traits detected: [list]
|
|
348
|
+
|
|
349
|
+
Overall score: [X] / [total checks] PASS
|
|
350
|
+
Critical gaps: [count of FAIL on high-priority controls]
|
|
351
|
+
Partial implementations: [count of PARTIAL]
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### 5.2 Critical gaps (FAIL — must fix)
|
|
355
|
+
|
|
356
|
+
List every check that received FAIL, ordered by priority:
|
|
357
|
+
|
|
358
|
+
1. OWASP-mapped controls first (these are active security vulnerabilities)
|
|
359
|
+
2. NIST MEASURE controls second (these are evaluation and testing gaps)
|
|
360
|
+
3. NIST MANAGE controls third (these are operational monitoring gaps)
|
|
361
|
+
4. ISO documentation requirements last (these are compliance documentation gaps)
|
|
362
|
+
|
|
363
|
+
For each gap:
|
|
364
|
+
- Control ID and description
|
|
365
|
+
- What is missing
|
|
366
|
+
- Which implement file to reference: `aigis get <file-id>`
|
|
367
|
+
- Specific pattern(s) to implement
|
|
368
|
+
- Estimated effort (small: <1 hour, medium: 1-4 hours, large: 4+ hours)
|
|
369
|
+
|
|
370
|
+
### 5.3 Partial implementations (PARTIAL — needs improvement)
|
|
371
|
+
|
|
372
|
+
List every check that received PARTIAL:
|
|
373
|
+
- What exists currently
|
|
374
|
+
- What is missing or insufficient
|
|
375
|
+
- Specific improvement needed
|
|
376
|
+
|
|
377
|
+
### 5.4 Passed controls (PASS — no action needed)
|
|
378
|
+
|
|
379
|
+
List every check that received PASS with evidence, for compliance documentation.
|
|
380
|
+
|
|
381
|
+
### 5.5 Recommended implementation order
|
|
382
|
+
|
|
383
|
+
Based on the gaps identified, provide a prioritized implementation plan:
|
|
384
|
+
|
|
385
|
+
1. **Immediate (security vulnerabilities):** Input validation, output sanitization, PII handling gaps
|
|
386
|
+
2. **Short-term (operational risk):** Audit logging, fallback patterns, rate limiting gaps
|
|
387
|
+
3. **Medium-term (compliance):** Monitoring, bias monitoring, explainability gaps
|
|
388
|
+
4. **Documentation:** Templates to generate (list specific `aigis template` commands)
|
|
389
|
+
|
|
390
|
+
### 5.6 Commands to run
|
|
391
|
+
|
|
392
|
+
Provide the exact aigis commands for the developer:
|
|
393
|
+
|
|
394
|
+
```
|
|
395
|
+
# Fetch patterns for all identified gaps:
|
|
396
|
+
aigis get [list of files with FAIL or PARTIAL checks]
|
|
397
|
+
|
|
398
|
+
# After implementing fixes, verify:
|
|
399
|
+
aigis verify [same list]
|
|
400
|
+
|
|
401
|
+
# Generate required compliance documentation:
|
|
402
|
+
aigis template [list from classification]
|
|
403
|
+
```
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: frameworks-index
|
|
3
|
+
title: Compact framework index
|
|
4
|
+
token_budget: ~1500
|
|
5
|
+
version: "1.1"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# NIST AI RMF 1.0
|
|
9
|
+
|
|
10
|
+
## GOVERN (cross-cutting)
|
|
11
|
+
- GOVERN 1: Policies, processes, procedures for AI risk management
|
|
12
|
+
- GOVERN 2: Accountability structures and roles
|
|
13
|
+
- GOVERN 3: Workforce diversity in AI risk teams
|
|
14
|
+
- GOVERN 4: Organizational risk culture
|
|
15
|
+
- GOVERN 5: External stakeholder engagement processes
|
|
16
|
+
- GOVERN 6: Third-party AI and supply chain policies
|
|
17
|
+
|
|
18
|
+
## MAP (context and risk identification)
|
|
19
|
+
- MAP 1: Context establishment (purpose, users, setting, laws)
|
|
20
|
+
- MAP 2: AI system categorization (tasks, methods, knowledge limits, data)
|
|
21
|
+
- MAP 3: Benefits and costs analysis (capabilities, benchmarks, oversight)
|
|
22
|
+
- MAP 4: Third-party component risk mapping
|
|
23
|
+
- MAP 5: Impact characterization (likelihood, magnitude)
|
|
24
|
+
|
|
25
|
+
## MEASURE (evaluation and testing)
|
|
26
|
+
- MEASURE 1: Methods and metrics selection
|
|
27
|
+
- MEASURE 2: Trustworthiness evaluation:
|
|
28
|
+
- 2.1: Test set and tool documentation
|
|
29
|
+
- 2.2: Human subject evaluation requirements
|
|
30
|
+
- 2.3: Performance in deployment conditions
|
|
31
|
+
- 2.4: Functionality monitoring in production
|
|
32
|
+
- 2.5: Validity, reliability, generalizability limits
|
|
33
|
+
- 2.6: Safety evaluation (fail-safe, monitoring, response)
|
|
34
|
+
- 2.7: Security and resilience evaluation
|
|
35
|
+
- 2.8: Transparency and accountability evaluation
|
|
36
|
+
- 2.9: Explainability and interpretability
|
|
37
|
+
- 2.10: Privacy risk evaluation
|
|
38
|
+
- 2.11: Fairness and bias evaluation
|
|
39
|
+
- 2.12: Environmental impact
|
|
40
|
+
- 2.13: TEVV effectiveness
|
|
41
|
+
- MEASURE 3: Risk tracking over time
|
|
42
|
+
- MEASURE 4: Measurement effectiveness feedback
|
|
43
|
+
|
|
44
|
+
## MANAGE (response and monitoring)
|
|
45
|
+
- MANAGE 1: Risk prioritization and response planning
|
|
46
|
+
- MANAGE 2: Benefit maximization / harm minimization
|
|
47
|
+
- MANAGE 3: Third-party risk management
|
|
48
|
+
- MANAGE 4: Post-deployment monitoring, incident response, change management
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
# OWASP Top 10 for LLM Applications (2025)
|
|
53
|
+
|
|
54
|
+
- LLM01: Prompt Injection — manipulating inputs to override instructions
|
|
55
|
+
- LLM02: Sensitive Information Disclosure — leaking PII, secrets, proprietary data
|
|
56
|
+
- LLM03: Supply Chain — third-party model, data, and plugin risks
|
|
57
|
+
- LLM04: Data and Model Poisoning — tampered training/RAG data
|
|
58
|
+
- LLM05: Improper Output Handling — unsanitized output to downstream systems
|
|
59
|
+
- LLM06: Excessive Agency — too much LLM autonomy, insufficient oversight
|
|
60
|
+
- LLM07: System Prompt Leakage — extraction of internal instructions (new 2025)
|
|
61
|
+
- LLM08: Vector and Embedding Weaknesses — RAG/embedding vulnerabilities (new 2025)
|
|
62
|
+
- LLM09: Misinformation — hallucinations, false facts, unverified claims
|
|
63
|
+
- LLM10: Unbounded Consumption — DoS, cost explosion, resource abuse
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
# ISO/IEC 42001:2023
|
|
68
|
+
|
|
69
|
+
## Clauses
|
|
70
|
+
- Clause 4: Context of the organization
|
|
71
|
+
- Clause 5: Leadership commitment and AI policy
|
|
72
|
+
- Clause 6: Planning (risk assessment, AI impact assessment, objectives)
|
|
73
|
+
- Clause 7: Support (resources, competence, documentation)
|
|
74
|
+
- Clause 8: Operation (controls, risk treatment, AI system impact assessment)
|
|
75
|
+
- Clause 9: Performance evaluation (monitoring, audit, management review)
|
|
76
|
+
- Clause 10: Improvement (corrective action, continual improvement)
|
|
77
|
+
|
|
78
|
+
## Annexes
|
|
79
|
+
- Annex A: Control objectives (A.2-A.10: policies, organization, resources, impact, lifecycle, data, transparency, use, third-party)
|
|
80
|
+
- Annex B: Implementation guidance
|
|
81
|
+
- Annex C: AI-specific objectives and risk sources
|
|
82
|
+
- Annex D: Cross-industry guidance
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.1",
|
|
3
|
+
"guardrails": [
|
|
4
|
+
{"id": "G1", "condition": "any_sensitive_data AND NOT audit-logging", "action": "ADD audit-logging", "rationale": "Sensitive data requires traceability"},
|
|
5
|
+
{"id": "G2", "condition": "handles-health AND NOT bias-monitoring", "action": "ADD bias-monitoring", "rationale": "Health data has demographic bias risks"},
|
|
6
|
+
{"id": "G3", "condition": "handles-financial AND influences-decisions AND NOT fallback-patterns", "action": "ADD fallback-patterns", "rationale": "Financial decisions need safe failure modes"},
|
|
7
|
+
{"id": "G4", "condition": "is-agentic AND NOT human-oversight", "action": "ADD human-oversight", "rationale": "Autonomous systems need oversight"},
|
|
8
|
+
{"id": "G5", "condition": "generates-code AND NOT output-sanitization", "action": "ADD output-sanitization", "rationale": "Generated code is execution risk"},
|
|
9
|
+
{"id": "G6", "condition": "jurisdiction-eu AND NOT explainability", "action": "ADD explainability", "rationale": "EU AI Act requires explainability"},
|
|
10
|
+
{"id": "G7", "condition": "jurisdiction-eu AND NOT bias-monitoring", "action": "ADD bias-monitoring", "rationale": "EU AI Act mandates non-discrimination"},
|
|
11
|
+
{"id": "G8", "condition": "handles-minors AND NOT human-oversight", "action": "ADD human-oversight", "rationale": "Systems affecting children require review"},
|
|
12
|
+
{"id": "G9", "condition": "multi-model-pipeline AND NOT monitoring", "action": "ADD monitoring", "rationale": "Multi-model compounding failures"},
|
|
13
|
+
{"id": "G10", "condition": "risk_tier=HIGH AND NOT monitoring", "action": "ADD monitoring", "rationale": "High-risk systems need monitoring"},
|
|
14
|
+
{"id": "G11", "condition": "risk_tier=HIGH AND NOT fallback-patterns", "action": "ADD fallback-patterns", "rationale": "High-risk systems must fail safely"},
|
|
15
|
+
{"id": "G12", "condition": "uses-llm AND NOT uses-thirdparty-api AND supply-chain SELECTED", "action": "REMOVE supply-chain", "rationale": "Self-hosted models skip third-party controls"},
|
|
16
|
+
{"id": "G13", "condition": "jurisdiction-us-regulated AND NOT audit-logging", "action": "ADD audit-logging", "rationale": "US regulated industries need audit trails"},
|
|
17
|
+
{"id": "G14", "condition": "jurisdiction-us-regulated AND NOT human-oversight", "action": "ADD human-oversight", "rationale": "US regulated industries need human review"},
|
|
18
|
+
{"id": "G15", "condition": "generates-code AND NOT human-oversight", "action": "ADD human-oversight", "rationale": "Code generation needs human review"}
|
|
19
|
+
],
|
|
20
|
+
"constraints": [
|
|
21
|
+
{"id": "C1", "rule": "is-internal AND is-external cannot both be true", "resolution": "Treat as is-external, log warning"}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: classification-taxonomy
|
|
3
|
+
title: System trait classification taxonomy
|
|
4
|
+
version: "1.1"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Classification taxonomy
|
|
8
|
+
|
|
9
|
+
Select all traits that apply to the AI system being built. The combination determines risk tier and which implement/ files to fetch.
|
|
10
|
+
|
|
11
|
+
## AI architecture
|
|
12
|
+
|
|
13
|
+
| Trait | Description | Triggers files |
|
|
14
|
+
|-------|-------------|----------------|
|
|
15
|
+
| uses-llm | System calls or embeds a large language model | input-validation, output-sanitization, prompt-security, audit-logging, monitoring |
|
|
16
|
+
| uses-rag | System retrieves context from a vector database before LLM inference | rag-security, data-integrity |
|
|
17
|
+
| uses-finetuned | System uses a fine-tuned or custom-trained model | data-integrity, supply-chain |
|
|
18
|
+
| uses-thirdparty-api | System calls an external model provider API | supply-chain |
|
|
19
|
+
| is-agentic | System takes actions autonomously (DB writes, API calls, code execution) | human-oversight, rate-limiting, fallback-patterns, audit-logging |
|
|
20
|
+
| is-multimodal | System processes or generates images, audio, or video | input-validation, output-sanitization, pii-handling |
|
|
21
|
+
|
|
22
|
+
## Data sensitivity
|
|
23
|
+
|
|
24
|
+
| Trait | Description | Triggers files |
|
|
25
|
+
|-------|-------------|----------------|
|
|
26
|
+
| processes-pii | System ingests, processes, or outputs personally identifiable information | pii-handling, audit-logging |
|
|
27
|
+
| handles-financial | System processes financial records, transactions, or credit data | pii-handling, audit-logging, bias-monitoring |
|
|
28
|
+
| handles-health | System processes health records, medical histories, or clinical data | pii-handling, audit-logging, bias-monitoring, explainability |
|
|
29
|
+
| handles-proprietary | System processes confidential business info or trade secrets | pii-handling, prompt-security |
|
|
30
|
+
| handles-minors | System may process data from or about minors | pii-handling, bias-monitoring, human-oversight |
|
|
31
|
+
|
|
32
|
+
## Impact scope
|
|
33
|
+
|
|
34
|
+
| Trait | Description | Triggers files |
|
|
35
|
+
|-------|-------------|----------------|
|
|
36
|
+
| influences-decisions | System output influences decisions about specific people | bias-monitoring, confidence-scoring, human-oversight, explainability |
|
|
37
|
+
| accepts-user-input | System accepts unstructured text input from users | input-validation, output-sanitization |
|
|
38
|
+
| is-external | System is accessible to customers or public users | rate-limiting, confidence-scoring |
|
|
39
|
+
| is-internal | System is accessible only to employees | (no direct file triggers — reduces risk tier if sole scope trait) |
|
|
40
|
+
| is-high-volume | System handles >1000 requests/day or >100 concurrent users | rate-limiting, monitoring, fallback-patterns |
|
|
41
|
+
|
|
42
|
+
## Output type
|
|
43
|
+
|
|
44
|
+
| Trait | Description | Triggers files |
|
|
45
|
+
|-------|-------------|----------------|
|
|
46
|
+
| generates-code | System produces code that is subsequently executed | output-sanitization, human-oversight, fallback-patterns |
|
|
47
|
+
| generates-content | System produces text/media published externally | confidence-scoring, bias-monitoring, audit-logging |
|
|
48
|
+
| multi-model-pipeline | System chains multiple AI models in sequence | audit-logging, monitoring, fallback-patterns, data-integrity |
|
|
49
|
+
|
|
50
|
+
## Regulatory jurisdiction
|
|
51
|
+
|
|
52
|
+
| Trait | Description | Effect |
|
|
53
|
+
|-------|-------------|--------|
|
|
54
|
+
| jurisdiction-eu | System deployed in or serving EU users (EU AI Act scope) | Elevates risk tier by one level. Forces ai-impact-assessment. Adds bias-monitoring and explainability via guardrails |
|
|
55
|
+
| jurisdiction-us-regulated | System in US regulated sector (HIPAA, FCRA, FERPA, etc.) | Forces ai-impact-assessment and intended-purpose-doc. Adds audit-logging and human-oversight via guardrails |
|
|
56
|
+
| jurisdiction-global | System serves users across multiple countries | Treated as jurisdiction-eu (applies strictest rules) |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
# Risk tier rules
|
|
61
|
+
|
|
62
|
+
HIGH if: influences-decisions OR handles-health OR (handles-financial AND accepts-user-input) OR handles-minors OR (jurisdiction-eu AND any-sensitive-data) OR (generates-code AND is-external) OR (generates-code AND is-agentic)
|
|
63
|
+
|
|
64
|
+
MEDIUM if: processes-pii OR is-external OR is-agentic OR handles-proprietary OR generates-content OR multi-model-pipeline OR jurisdiction-us-regulated OR generates-code
|
|
65
|
+
|
|
66
|
+
LOW if: none of the above
|
|
67
|
+
|
|
68
|
+
Modifier: jurisdiction-eu elevates tier by one level (LOW->MEDIUM, MEDIUM->HIGH). jurisdiction-global treated as jurisdiction-eu.
|
|
69
|
+
Modifier: is-internal with no other medium/high triggers keeps tier at LOW.
|
|
70
|
+
Constraint: is-internal and is-external cannot both be true. If both provided, treat as is-external and log warning.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
# Templates by risk tier
|
|
75
|
+
|
|
76
|
+
HIGH: ai-impact-assessment, intended-purpose-doc, risk-characterization, third-party-assessment (if uses-thirdparty-api)
|
|
77
|
+
MEDIUM: intended-purpose-doc, third-party-assessment (if uses-thirdparty-api)
|
|
78
|
+
LOW: none required (intended-purpose-doc recommended)
|
|
79
|
+
|
|
80
|
+
Override: jurisdiction-eu always forces ai-impact-assessment regardless of tier.
|
|
81
|
+
Override: jurisdiction-us-regulated always forces ai-impact-assessment and intended-purpose-doc regardless of tier.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: ai-impact-assessment
|
|
3
|
+
title: AI Impact Assessment Template
|
|
4
|
+
framework: ISO 42001 Clause 6.1.4 / Clause 8.4
|
|
5
|
+
required_when: risk_tier=HIGH OR jurisdiction-eu OR influences-decisions
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# AI Impact Assessment
|
|
9
|
+
|
|
10
|
+
> The agent fills in each section based on the system being built. This document maps to ISO/IEC 42001:2023 Clause 8.4 (AI System Impact Assessment).
|
|
11
|
+
|
|
12
|
+
## 1. System identification
|
|
13
|
+
- **System name:** [Extract the name from the task description or code module name. Example: "Claims Severity Assessment API"]
|
|
14
|
+
- **Version:** [Use semantic versioning: 0.1.0 for first deployment]
|
|
15
|
+
- **Date:** [Use semantic versioning: 0.1.0 for first deployment]
|
|
16
|
+
- **Assessment author:** AI-assisted (review required by [role])
|
|
17
|
+
|
|
18
|
+
## 2. Intended purpose
|
|
19
|
+
- **What does this system do?** [Summarize in 1-2 sentences what the system does, not how it works technically. Example: "Assesses insurance claim severity using NLP to recommend routing to fast-track, standard, or escalated review"]
|
|
20
|
+
- **Who are the intended users?** [List the user roles who interact with the system directly. Example: "Claims processing staff (800 users across 6 offices)"]
|
|
21
|
+
- **What decisions does it support or make?** [Describe the specific decisions this output influences. Example: "Determines initial routing of insurance claims, affecting speed of resolution and adjuster workload"]
|
|
22
|
+
|
|
23
|
+
## 3. Affected populations
|
|
24
|
+
- **Who is directly affected by this system's output?** [Describe the specific decisions this output influences. Example: "Determines initial routing of insurance claims, affecting speed of resolution and adjuster workload"]
|
|
25
|
+
- **Are any vulnerable populations affected?** (minors, elderly, economically disadvantaged) [check traits]
|
|
26
|
+
- **Estimated number of affected individuals:** [inferred from scale]
|
|
27
|
+
|
|
28
|
+
## 4. Potential negative impacts
|
|
29
|
+
| Impact | Likelihood | Severity | Affected group | Mitigation |
|
|
30
|
+
|--------|-----------|----------|----------------|------------|
|
|
31
|
+
| [For each risk, describe: what goes wrong, who is harmed, how severely. Example: "High-severity claim under-assessed → customer experiences delayed payout and potential financial hardship"] | Low/Med/High | Low/Med/High | [group] | [Reference the specific implement file and pattern number. Example: "Input sanitization (input-validation.md P1-P3), PII redaction (pii-handling.md P1)"] |
|
|
32
|
+
|
|
33
|
+
## 5. Controls implemented
|
|
34
|
+
| Control | Implementation | Framework reference |
|
|
35
|
+
|---------|---------------|-------------------|
|
|
36
|
+
| [List each implement file used, the specific patterns applied, and the function/module that implements them] | [Reference the exact function name and file location. Example: "sanitize_input() in app/middleware/validation.py"] | [Copy the control IDs from the implement file frontmatter. Example: "OWASP LLM01, NIST MEASURE-2.7, ISO Cl.8.2"] |
|
|
37
|
+
|
|
38
|
+
## 6. Residual risks
|
|
39
|
+
- [List risks that controls cannot fully eliminate. For each: describe the risk, why it persists, and why the residual level is acceptable. Example: "Novel prompt injection techniques may bypass pattern detection. Residual risk accepted because output schema validation (P4) limits damage, and human oversight catches anomalies."]
|
|
40
|
+
|
|
41
|
+
## 7. Human oversight mechanism
|
|
42
|
+
- **Override available:** Yes/No
|
|
43
|
+
- **Escalation path:** [Describe the specific override mechanism implemented: endpoint URL, who can trigger it, what happens when triggered]
|
|
44
|
+
- **Kill switch:** [Describe the kill switch: where the config lives, who has access, what disabling looks like, recovery process]
|
|
45
|
+
|
|
46
|
+
## 8. Monitoring plan
|
|
47
|
+
- **Metrics tracked:** [List the specific metrics from monitoring.md Pattern 1 that are being tracked for this system]
|
|
48
|
+
- **Review frequency:** [HIGH: weekly metric review, monthly bias audit, quarterly red-team. MEDIUM: monthly metric review, quarterly bias check. LOW: quarterly metric review]
|
|
49
|
+
- **Responsible party:** [role, not auto-filled — requires human input]
|
|
50
|
+
|
|
51
|
+
## 9. Review and approval
|
|
52
|
+
- **Assessment reviewed by:** _________________ (required: human reviewer)
|
|
53
|
+
- **Date:** _________________
|
|
54
|
+
- **Approved for deployment:** Yes / No / Conditional
|