Skip to content

Commit deb9707

Browse files
committed
Risks looking good.
1 parent e4047c4 commit deb9707

File tree

148 files changed

+29290
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+29290
-178
lines changed
File renamed without changes.

.dev/nist-ai-rmf.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
2+
# GOVERN — Organizational risk governance
3+
4+
## GOVERN 1 — Risk management policies and processes exist
5+
6+
* **1.1** Legal/regulatory AI requirements are understood and documented.
7+
* **1.2** Trustworthy-AI characteristics are embedded into org policies and practices.
8+
* **1.3** Required level of AI risk management is determined by risk tolerance.
9+
* **1.4** Transparent risk-management procedures and controls are established.
10+
* **1.5** Ongoing monitoring, review cadence, and responsibilities are defined.
11+
* **1.6** AI system inventory exists and is resourced by risk priority.
12+
* **1.7** Safe decommissioning/phase-out procedures are defined.
13+
14+
**Theme:** institutionalize lifecycle AI risk governance.
15+
16+
---
17+
18+
## GOVERN 2 — Accountability structures
19+
20+
* **2.1** Roles, responsibilities, and reporting lines for AI risk are documented.
21+
* **2.2** Personnel and partners receive AI risk-management training.
22+
* **2.3** Executive leadership is accountable for AI risk decisions.
23+
24+
**Theme:** governance must reach the C-suite.
25+
26+
---
27+
28+
## GOVERN 3 — Workforce diversity & inclusion in risk
29+
30+
* **3.1** Diverse, interdisciplinary teams inform AI risk decisions.
31+
* **3.2** Human-AI oversight roles and responsibilities are clearly defined.
32+
33+
**Theme:** socio-technical risk requires diverse perspectives.
34+
35+
---
36+
37+
## GOVERN 4 — Risk-aware organizational culture
38+
39+
* **4.1** Safety-first and critical-thinking culture is embedded.
40+
* **4.2** AI risks and impacts are documented and communicated.
41+
* **4.3** Testing, incident detection, and information-sharing practices exist.
42+
43+
**Theme:** culture is a control surface.
44+
45+
---
46+
47+
## GOVERN 5 — External engagement
48+
49+
* **5.1** Feedback from affected stakeholders is collected and integrated.
50+
* **5.2** Adjudicated external feedback informs system design and updates.
51+
52+
**Theme:** legitimacy requires stakeholder input.
53+
54+
---
55+
56+
## GOVERN 6 — Third-party & supply-chain risk
57+
58+
* **6.1** Policies address third-party IP, data, and AI risks.
59+
* **6.2** Contingency plans exist for third-party failures/incidents.
60+
61+
**Theme:** AI supply chain = risk multiplier.
62+
63+
---
64+
65+
# MAP — Context and risk identification
66+
67+
## MAP 1 — Context establishment
68+
69+
* **1.1** Intended use, impacts, laws, users, and assumptions documented.
70+
* **1.2** Diverse interdisciplinary context-setting participation ensured.
71+
* **1.3** Organizational mission/goals for AI documented.
72+
* **1.4** Business value/use context defined or re-evaluated.
73+
* **1.5** Risk tolerance determined and documented.
74+
* **1.6** Socio-technical system requirements defined.
75+
76+
**Theme:** risk begins with context clarity.
77+
78+
---
79+
80+
## MAP 2 — AI system categorization
81+
82+
* **2.1** Tasks/methods (e.g., generative, classifier) defined.
83+
* **2.2** Knowledge limits, human oversight, and usage constraints documented.
84+
* **2.3** Scientific integrity and TEVV considerations documented.
85+
86+
**Theme:** know what kind of AI you built.
87+
88+
---
89+
90+
## MAP 3 — Capabilities, benefits, and costs
91+
92+
* **3.1** Expected benefits documented.
93+
* **3.2** Expected harms and non-monetary costs documented.
94+
* **3.3** Application scope specified.
95+
* **3.4** Operator proficiency requirements defined.
96+
* **3.5** Human-oversight processes defined.
97+
98+
**Theme:** capability ≠ acceptability.
99+
100+
---
101+
102+
## MAP 4 — Component-level risk mapping
103+
104+
* **4.1** Legal/technical risks of components and third-party assets mapped.
105+
* **4.2** Internal controls for components documented.
106+
107+
**Theme:** decompose the system to see risk.
108+
109+
---
110+
111+
## MAP 5 — Impact characterization
112+
113+
* **5.1** Likelihood and magnitude of impacts identified.
114+
* **5.2** Continuous stakeholder engagement mechanisms exist.
115+
116+
**Theme:** quantify harm before deployment.
117+
118+
---
119+
120+
# MEASURE — Risk analysis and validation
121+
122+
## MEASURE 1 — Metrics and methodologies
123+
124+
* **1.1** Metrics selected for highest-priority risks.
125+
* **1.2** Metric effectiveness and controls regularly reassessed.
126+
* **1.3** Independent/internal/external experts participate in assessment.
127+
128+
**Theme:** measurement must be credible.
129+
130+
---
131+
132+
## MEASURE 2 — Trustworthiness evaluation
133+
134+
* **2.1** Test sets, metrics, and tools documented.
135+
* **2.2** Human-subject evaluations meet protections/requirements.
136+
137+
**Theme:** TEVV formalizes AI assurance.

.dev/owasp/agentic-top-10.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
# OWASP Top 10 for Agentic Applications — brief summaries
3+
4+
## ASI01 — Agent Goal Hijack
5+
6+
Attackers manipulate an agent’s **objectives, plans, or decision paths** through prompt injection, malicious artifacts, deceptive tool output, or poisoned data.
7+
Unlike classic prompt injection that changes one response, this redirects **multi-step autonomous behavior** toward harmful outcomes.
8+
9+
---
10+
11+
## ASI02 — Tool Misuse and Exploitation
12+
13+
Agents misuse **legitimate tools within their permissions**—for example deleting data, over-invoking APIs, or exfiltrating information—due to unsafe delegation, injection, or ambiguity.
14+
The danger lies in **unsafe application of authorized capability**, not privilege escalation.
15+
16+
---
17+
18+
## ASI03 — Identity and Privilege Abuse
19+
20+
Dynamic delegation, cached credentials, and cross-agent trust allow attackers to **escalate access or impersonate identities**, bypassing least-privilege controls and executing unauthorized actions.
21+
This reflects an architectural gap between **human-centric IAM and autonomous agents**.
22+
23+
---
24+
25+
## ASI04 — Agentic Supply-Chain Vulnerabilities
26+
27+
Third-party models, tools, prompts, agents, registries, or datasets may be **malicious, compromised, or tampered with**, especially because agentic systems load components **dynamically at runtime**, expanding the attack surface.
28+
29+
---
30+
31+
## ASI05 — Unexpected Code Execution (RCE)
32+
33+
Generated or injected code can be **executed by the agent**, leading to remote code execution, sandbox escape, persistence, or host compromise—often bypassing traditional controls because execution is **agent-driven and real-time**.
34+
35+
---
36+
37+
## ASI06 — Memory & Context Poisoning
38+
39+
Attackers corrupt stored **memory, embeddings, summaries, or RAG context**, causing persistent bias, unsafe reasoning, or data leakage across sessions and agents.
40+
This is **long-term contamination**, not a one-time prompt attack.
41+
42+
---
43+
44+
## ASI07 — Insecure Inter-Agent Communication
45+
46+
Weak authentication, integrity, or confidentiality in **agent-to-agent messaging** enables interception, spoofing, replay, or semantic manipulation, compromising coordination across distributed agent systems.
47+
48+
---
49+
50+
## ASI08 — Cascading Failures
51+
52+
A single hallucination, poisoned input, or compromised component can **propagate across autonomous agents**, amplifying into system-wide failure because agents plan, persist, and delegate without human checkpoints.
53+
54+
---
55+
56+
## ASI09 — Human-Agent Trust Exploitation
57+
58+
Attackers exploit **human trust, authority bias, or anthropomorphism** to manipulate users into approving harmful actions, disclosing secrets, or making unsafe decisions—while the agent’s role remains hard to trace.
59+
60+
---
61+
62+
## ASI10 — Rogue Agents
63+
64+
Agents that become **malicious, misaligned, collusive, or self-propagating** deviate from intended behavior and sabotage workflows, leak data, or manipulate systems—even if individual actions appear legitimate.

.dev/owasp/llm-apps-top-10.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# OWASP Top 10 for LLM Applications 2025 — brief summaries
2+
3+
## LLM01 — Prompt Injection
4+
5+
Malicious or unintended inputs manipulate model behavior, bypass safeguards, expose data, trigger tool use, or alter decisions—even when hidden in external content or multimodal inputs.
6+
Mitigation relies on constrained behavior, strict validation, filtering, least-privilege access, and human approval for high-risk actions.
7+
8+
---
9+
10+
## LLM02 — Sensitive Information Disclosure
11+
12+
LLMs may reveal **PII, credentials, proprietary data, or training information** through outputs or model behavior, causing privacy or IP breaches.
13+
Defenses include sanitization, strict access control, privacy-preserving learning, transparency, and secure configuration.
14+
15+
---
16+
17+
## LLM03 — Supply Chain
18+
19+
Risks arise from **third-party models, datasets, libraries, fine-tuning adapters, or cloud infrastructure**, which may be vulnerable, poisoned, tampered, or malicious.
20+
Mitigation centers on provenance, red-teaming, SBOMs, patching, licensing governance, and integrity verification.
21+
22+
---
23+
24+
## LLM04 — Data and Model Poisoning
25+
26+
Attackers manipulate **training, fine-tuning, or embedding data** to introduce bias, backdoors, or degraded behavior—potentially creating sleeper-agent-style triggers.
27+
Controls include dataset provenance tracking, validation, sandboxing, anomaly detection, versioning, and adversarial testing.
28+
29+
---
30+
31+
## LLM05 — Improper Output Handling
32+
33+
Unsanitized LLM outputs passed into downstream systems can enable **XSS, SQL injection, SSRF, privilege escalation, or remote code execution**.
34+
Secure design treats model output as untrusted input, enforcing validation, encoding, parameterization, monitoring, and zero-trust handling.
35+
36+
---
37+
38+
## LLM06 — Excessive Agency
39+
40+
Granting LLMs **too much autonomy, functionality, or permission** enables damaging real-world actions triggered by hallucination, injection, or ambiguity.
41+
Mitigation focuses on minimizing extensions, permissions, and autonomy, enforcing authorization externally, and requiring human approval for critical actions.
42+
43+
---
44+
45+
## LLM07 — System Prompt Leakage
46+
47+
System prompts may expose **secrets, permissions, architecture, or filtering logic**, enabling attackers to bypass controls or escalate privileges.
48+
Security must not rely on hidden prompts; sensitive data and enforcement should reside outside the LLM.
49+
50+
---
51+
52+
## LLM08 — Vector and Embedding Weaknesses
53+
54+
Weaknesses in **RAG pipelines, embeddings, or vector stores** can enable data leakage, poisoning, or retrieval manipulation that corrupts model grounding and outputs.
55+
Securing retrieval infrastructure and validating embedded data are key defenses.
56+
57+
---
58+
59+
## LLM09 — Misinformation
60+
61+
LLMs can generate **incorrect, biased, or fabricated information** that influences users or decisions, creating reputational, legal, or operational harm.
62+
Mitigation requires validation, provenance, monitoring, and human oversight of high-impact outputs.
63+
64+
---
65+
66+
## LLM10 — Unbounded Consumption
67+
68+
LLM usage may cause **excessive resource consumption, denial-of-wallet costs, or uncontrolled scaling**, expanding traditional DoS into economic and operational risk.
69+
Controls include rate limiting, quotas, monitoring, and resource governance.
70+
71+
---
72+
73+
# Structural insight (useful for your Risk-First framing)
74+
75+
Compared with the **Agentic Top 10**, this list focuses more on:
76+
77+
* **Model- and data-centric vulnerabilities**
78+
* **Application-level security failures**
79+
* **Resource and information risks**
80+
81+
— whereas agentic risks emphasize **autonomy, delegation, and systemic behavior**.
82+
83+
This distinction is useful for framing:
84+
85+
**LLM risk = information & pipeline security**
86+
**Agentic risk = autonomous action & system control**

.dev/scripts/validate.sh

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/bin/bash
2+
# Validate Gemara front matter against CUE schema
3+
# Usage: ./.dev/scripts/validate.sh
4+
5+
set -e
6+
7+
cd "$(dirname "$0")/../.."
8+
9+
# Check dependencies
10+
command -v cue >/dev/null 2>&1 || { echo "❌ CUE not installed. Run: brew install cue"; exit 1; }
11+
command -v yq >/dev/null 2>&1 || { echo "❌ yq not installed. Run: brew install yq"; exit 1; }
12+
13+
ERRORS=0
14+
15+
validate_file() {
16+
local file="$1"
17+
local schema="$2"
18+
19+
# Extract front matter and get gemara as JSON
20+
frontmatter=$(awk '/^---$/{if(p)exit;p=1;next}p' "$file")
21+
gemara_yaml=$(echo "$frontmatter" | yq '.gemara' 2>/dev/null)
22+
23+
if [ "$gemara_yaml" = "null" ] || [ -z "$gemara_yaml" ]; then
24+
echo "$file - no gemara front matter"
25+
return 0
26+
fi
27+
28+
# Write gemara YAML to temp file for validation
29+
tmpfile=$(mktemp).yaml
30+
echo "$gemara_yaml" > "$tmpfile"
31+
32+
if cue vet "$tmpfile" ./.dev/cue/gemara/*.cue -d "$schema" 2>/dev/null; then
33+
echo "$file"
34+
rm -f "$tmpfile"
35+
return 0
36+
else
37+
echo "$file - validation failed"
38+
cue vet "$tmpfile" ./.dev/cue/gemara/*.cue -d "$schema" 2>&1 | head -5 | sed 's/^/ /'
39+
rm -f "$tmpfile"
40+
return 1
41+
fi
42+
}
43+
44+
echo "🔍 Validating risk files against #Threat schema..."
45+
for file in risks/*.md; do
46+
if [ -f "$file" ]; then
47+
validate_file "$file" "#Threat" || ERRORS=$((ERRORS + 1))
48+
fi
49+
done
50+
51+
echo ""
52+
echo "🔍 Validating practice files against #Control schema..."
53+
for file in practices/*.md; do
54+
if [ -f "$file" ]; then
55+
validate_file "$file" "#Control" || ERRORS=$((ERRORS + 1))
56+
fi
57+
done
58+
59+
echo ""
60+
echo "🔍 Validating capability files against #Capability schema..."
61+
for file in capabilities/*.md; do
62+
if [ -f "$file" ]; then
63+
validate_file "$file" "#Capability" || ERRORS=$((ERRORS + 1))
64+
fi
65+
done
66+
67+
echo ""
68+
if [ $ERRORS -eq 0 ]; then
69+
echo "✅ All validations passed!"
70+
exit 0
71+
else
72+
echo "$ERRORS validation error(s) found"
73+
exit 1
74+
fi

.github/workflows/validate-gemara.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
sudo chmod +x /usr/local/bin/yq
2323
2424
- name: Validate Gemara front matter
25-
run: ./scripts/validate.sh
25+
run: ./.dev/scripts/validate.sh

0 commit comments

Comments
 (0)