cinch-ai-security 1.0.0__tar.gz
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.
- cinch_ai_security-1.0.0/.claude/settings.local.json +11 -0
- cinch_ai_security-1.0.0/.github/dependabot.yml +29 -0
- cinch_ai_security-1.0.0/.github/workflows/pages.yml +52 -0
- cinch_ai_security-1.0.0/.github/workflows/validate.yaml +108 -0
- cinch_ai_security-1.0.0/.github-pages-config +10 -0
- cinch_ai_security-1.0.0/.gitignore +26 -0
- cinch_ai_security-1.0.0/CODE_OF_CONDUCT.md +21 -0
- cinch_ai_security-1.0.0/CONTRIBUTING.md +60 -0
- cinch_ai_security-1.0.0/LICENSE +396 -0
- cinch_ai_security-1.0.0/PKG-INFO +226 -0
- cinch_ai_security-1.0.0/README.md +195 -0
- cinch_ai_security-1.0.0/SECURITY.md +63 -0
- cinch_ai_security-1.0.0/checklists/agent-containment.yaml +348 -0
- cinch_ai_security-1.0.0/checklists/agent-environment.yaml +195 -0
- cinch_ai_security-1.0.0/checklists/harness-engineering.yaml +316 -0
- cinch_ai_security-1.0.0/checklists/red-team.yaml +269 -0
- cinch_ai_security-1.0.0/checklists/supply-chain.yaml +214 -0
- cinch_ai_security-1.0.0/checklists/system-hardening.yaml +270 -0
- cinch_ai_security-1.0.0/cross-harness/claude/CLAUDE.md +75 -0
- cinch_ai_security-1.0.0/cross-harness/nanoclaw/agent-config.yaml +79 -0
- cinch_ai_security-1.0.0/cross-harness/openclaw/agent-config.yaml +66 -0
- cinch_ai_security-1.0.0/docs/_config.yml +6 -0
- cinch_ai_security-1.0.0/docs/design-rationale.md +67 -0
- cinch_ai_security-1.0.0/docs/research-references.md +78 -0
- cinch_ai_security-1.0.0/docs/threat-model.md +100 -0
- cinch_ai_security-1.0.0/docs-site/css/brand.css +218 -0
- cinch_ai_security-1.0.0/docs-site/data/full.json +2513 -0
- cinch_ai_security-1.0.0/docs-site/index.html +69 -0
- cinch_ai_security-1.0.0/docs-site/js/app.js +382 -0
- cinch_ai_security-1.0.0/docs-site/pages/checklist-detail.html +69 -0
- cinch_ai_security-1.0.0/docs-site/pages/checklists.html +69 -0
- cinch_ai_security-1.0.0/docs-site/pages/mapping-detail.html +69 -0
- cinch_ai_security-1.0.0/docs-site/pages/mappings.html +69 -0
- cinch_ai_security-1.0.0/docs-site/pages/mcp-server.html +69 -0
- cinch_ai_security-1.0.0/docs-site/pages/protocol-detail.html +69 -0
- cinch_ai_security-1.0.0/docs-site/pages/protocols.html +69 -0
- cinch_ai_security-1.0.0/docs-site/pages/quickstart.html +69 -0
- cinch_ai_security-1.0.0/docs-site/pages/skill-detail.html +69 -0
- cinch_ai_security-1.0.0/docs-site/pages/skills.html +69 -0
- cinch_ai_security-1.0.0/docs-site/pages/template-detail.html +69 -0
- cinch_ai_security-1.0.0/docs-site/pages/templates.html +69 -0
- cinch_ai_security-1.0.0/docs-site/pages/threat-model.html +69 -0
- cinch_ai_security-1.0.0/mappings/atlas-crosswalk.yaml +119 -0
- cinch_ai_security-1.0.0/mappings/custody-crosswalk.yaml +79 -0
- cinch_ai_security-1.0.0/mappings/lasm-crosswalk.yaml +119 -0
- cinch_ai_security-1.0.0/mappings/nist-rmf-crosswalk.yaml +177 -0
- cinch_ai_security-1.0.0/mappings/owasp-llm-crosswalk.yaml +116 -0
- cinch_ai_security-1.0.0/protocols/agent-deployment.md +323 -0
- cinch_ai_security-1.0.0/protocols/evidence-collect.md +140 -0
- cinch_ai_security-1.0.0/protocols/harness-setup.md +450 -0
- cinch_ai_security-1.0.0/protocols/incident-response.md +347 -0
- cinch_ai_security-1.0.0/protocols/red-team-engagement.md +418 -0
- cinch_ai_security-1.0.0/pyproject.toml +57 -0
- cinch_ai_security-1.0.0/scripts/build_docs_json.py +141 -0
- cinch_ai_security-1.0.0/scripts/migrate_schema.py +212 -0
- cinch_ai_security-1.0.0/skills/agent-audit/SKILL.md +134 -0
- cinch_ai_security-1.0.0/skills/ai-harness-review/SKILL.md +102 -0
- cinch_ai_security-1.0.0/skills/ai-red-team/SKILL.md +97 -0
- cinch_ai_security-1.0.0/src/cinch/__init__.py +3 -0
- cinch_ai_security-1.0.0/src/cinch/loader.py +366 -0
- cinch_ai_security-1.0.0/src/cinch/server.py +281 -0
- cinch_ai_security-1.0.0/templates/adr-agent-deployment.md +100 -0
- cinch_ai_security-1.0.0/templates/agent-policy.md +156 -0
- cinch_ai_security-1.0.0/templates/risk-assessment.md +127 -0
- cinch_ai_security-1.0.0/templates/security-review.md +134 -0
- cinch_ai_security-1.0.0/tests/test_loader.py +165 -0
- cinch_ai_security-1.0.0/tests/test_server.py +155 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Dependabot keeps Cinch's dependencies and CI actions current.
|
|
2
|
+
# Security-critical for a tool that itself enforces supply-chain controls.
|
|
3
|
+
version: 2
|
|
4
|
+
updates:
|
|
5
|
+
# Python runtime + dev dependencies.
|
|
6
|
+
- package-ecosystem: "pip"
|
|
7
|
+
directory: "/"
|
|
8
|
+
schedule:
|
|
9
|
+
interval: "weekly"
|
|
10
|
+
day: "monday"
|
|
11
|
+
open-pull-requests-limit: 5
|
|
12
|
+
labels:
|
|
13
|
+
- "dependencies"
|
|
14
|
+
- "python"
|
|
15
|
+
commit-message:
|
|
16
|
+
prefix: "deps(pip)"
|
|
17
|
+
|
|
18
|
+
# GitHub Actions used in CI/Pages workflows.
|
|
19
|
+
- package-ecosystem: "github-actions"
|
|
20
|
+
directory: "/"
|
|
21
|
+
schedule:
|
|
22
|
+
interval: "weekly"
|
|
23
|
+
day: "monday"
|
|
24
|
+
open-pull-requests-limit: 5
|
|
25
|
+
labels:
|
|
26
|
+
- "dependencies"
|
|
27
|
+
- "github-actions"
|
|
28
|
+
commit-message:
|
|
29
|
+
prefix: "deps(actions)"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Deploy Docs
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
|
|
7
|
+
# Permissions: minimal everywhere except Pages deployment.
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
pages: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
# Allow only one concurrent Pages deployment.
|
|
14
|
+
concurrency:
|
|
15
|
+
group: pages
|
|
16
|
+
cancel-in-progress: true
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
build:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Set up Python
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.13"
|
|
28
|
+
|
|
29
|
+
- name: Regenerate docs data bundle
|
|
30
|
+
run: |
|
|
31
|
+
python -m pip install --upgrade pip
|
|
32
|
+
pip install pyyaml
|
|
33
|
+
python scripts/build_docs_json.py
|
|
34
|
+
|
|
35
|
+
- name: Setup Pages
|
|
36
|
+
uses: actions/configure-pages@v5
|
|
37
|
+
|
|
38
|
+
- name: Upload artifact
|
|
39
|
+
uses: actions/upload-pages-artifact@v3
|
|
40
|
+
with:
|
|
41
|
+
path: docs-site
|
|
42
|
+
|
|
43
|
+
deploy:
|
|
44
|
+
needs: build
|
|
45
|
+
runs-on: ubuntu-latest
|
|
46
|
+
environment:
|
|
47
|
+
name: github-pages
|
|
48
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
49
|
+
steps:
|
|
50
|
+
- name: Deploy to GitHub Pages
|
|
51
|
+
id: deployment
|
|
52
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
name: Validate
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
pull_request:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
validate:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- name: Set up Python
|
|
15
|
+
uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.13"
|
|
18
|
+
cache: pip
|
|
19
|
+
|
|
20
|
+
- name: Install dependencies
|
|
21
|
+
run: |
|
|
22
|
+
python -m pip install --upgrade pip
|
|
23
|
+
pip install -e ".[dev]"
|
|
24
|
+
pip install bandit pip-audit
|
|
25
|
+
|
|
26
|
+
- name: Validate YAML checklists & mappings
|
|
27
|
+
run: |
|
|
28
|
+
python3 -c "
|
|
29
|
+
import yaml, glob, sys
|
|
30
|
+
errors = []
|
|
31
|
+
for f in sorted(glob.glob('checklists/*.yaml') + glob.glob('mappings/*.yaml')):
|
|
32
|
+
try:
|
|
33
|
+
data = yaml.safe_load(open(f))
|
|
34
|
+
items = data.get('checklist', data.get('mappings', []))
|
|
35
|
+
print(f' {f}: {len(items)} items OK')
|
|
36
|
+
except Exception as e:
|
|
37
|
+
errors.append(f'{f}: {e}')
|
|
38
|
+
if errors:
|
|
39
|
+
for e in errors:
|
|
40
|
+
print(f'ERROR: {e}')
|
|
41
|
+
sys.exit(1)
|
|
42
|
+
print('All YAML files valid.')
|
|
43
|
+
"
|
|
44
|
+
|
|
45
|
+
- name: Validate MCP server imports
|
|
46
|
+
run: |
|
|
47
|
+
python3 -c "
|
|
48
|
+
from cinch.loader import list_checklists, load_checklist, load_mapping, search_by_threat
|
|
49
|
+
from cinch.server import APP
|
|
50
|
+
checklists = list_checklists()
|
|
51
|
+
print(f'Loaded {len(checklists)} checklists')
|
|
52
|
+
for cl in checklists:
|
|
53
|
+
print(f' {cl[\"name\"]}: {cl[\"item_count\"]} items')
|
|
54
|
+
print('MCP server imports OK')
|
|
55
|
+
"
|
|
56
|
+
|
|
57
|
+
- name: Validate checklist IDs are unique
|
|
58
|
+
run: |
|
|
59
|
+
python3 -c "
|
|
60
|
+
import yaml, glob
|
|
61
|
+
seen = {}
|
|
62
|
+
for f in sorted(glob.glob('checklists/*.yaml')):
|
|
63
|
+
data = yaml.safe_load(open(f))
|
|
64
|
+
for item in data.get('checklist', []):
|
|
65
|
+
iid = item['id']
|
|
66
|
+
if iid in seen:
|
|
67
|
+
print(f'DUPLICATE: {iid} in {f} and {seen[iid]}')
|
|
68
|
+
seen[iid] = f
|
|
69
|
+
print(f'{len(seen)} unique IDs across all checklists')
|
|
70
|
+
"
|
|
71
|
+
|
|
72
|
+
- name: Lint (ruff)
|
|
73
|
+
run: ruff check src tests
|
|
74
|
+
|
|
75
|
+
- name: Security scan (bandit)
|
|
76
|
+
run: bandit -r src -q
|
|
77
|
+
|
|
78
|
+
- name: Dependency audit (pip-audit)
|
|
79
|
+
run: pip-audit --strict
|
|
80
|
+
|
|
81
|
+
- name: Verify checklist content integrity
|
|
82
|
+
run: |
|
|
83
|
+
python3 -c "
|
|
84
|
+
from cinch.loader import list_checklists, load_checklist
|
|
85
|
+
failures = []
|
|
86
|
+
for c in list_checklists():
|
|
87
|
+
cl = load_checklist(c['name'])
|
|
88
|
+
for it in cl.items:
|
|
89
|
+
if not it.threat or not it.control or not it.verification:
|
|
90
|
+
failures.append(f\"{c['name']}/{it.id} has empty threat/control/verification\")
|
|
91
|
+
if failures:
|
|
92
|
+
for f in failures:
|
|
93
|
+
print(f'ERROR: {f}')
|
|
94
|
+
raise SystemExit(1)
|
|
95
|
+
print('All checklist items have non-empty core fields.')
|
|
96
|
+
"
|
|
97
|
+
|
|
98
|
+
- name: Tests (pytest)
|
|
99
|
+
run: pytest -q
|
|
100
|
+
|
|
101
|
+
- name: Verify docs-site data bundle is in sync
|
|
102
|
+
run: |
|
|
103
|
+
python3 scripts/build_docs_json.py
|
|
104
|
+
if ! git diff --exit-code docs-site/data/full.json; then
|
|
105
|
+
echo "::error::docs-site/data/full.json is out of sync. Run 'python scripts/build_docs_json.py' and commit the result."
|
|
106
|
+
git --no-pager diff docs-site/data/full.json | head -40
|
|
107
|
+
exit 1
|
|
108
|
+
fi
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.pyc
|
|
4
|
+
*.egg-info/
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
*.egg
|
|
8
|
+
|
|
9
|
+
# Node
|
|
10
|
+
node_modules/
|
|
11
|
+
|
|
12
|
+
# Environment
|
|
13
|
+
.env
|
|
14
|
+
.venv/
|
|
15
|
+
|
|
16
|
+
# OS
|
|
17
|
+
.DS_Store
|
|
18
|
+
Thumbs.db
|
|
19
|
+
|
|
20
|
+
# IDE
|
|
21
|
+
.idea/
|
|
22
|
+
.vscode/
|
|
23
|
+
*.swp
|
|
24
|
+
*.swo
|
|
25
|
+
__pycache__/
|
|
26
|
+
*.pyc
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
We pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity, education, socio-economic status, nationality, race, religion, or sexual orientation.
|
|
4
|
+
|
|
5
|
+
## Our Standards
|
|
6
|
+
|
|
7
|
+
**Positive behavior includes:**
|
|
8
|
+
- Demonstrating empathy and kindness
|
|
9
|
+
- Being respectful of differing opinions
|
|
10
|
+
- Giving and accepting constructive feedback
|
|
11
|
+
- Citing sources and being precise in technical claims
|
|
12
|
+
- Focusing on what is best for the community
|
|
13
|
+
|
|
14
|
+
**Unacceptable behavior includes:**
|
|
15
|
+
- Harassment, personal attacks, or derogatory comments
|
|
16
|
+
- Publishing others' private information without permission
|
|
17
|
+
- Other conduct that would be inappropriate in a professional setting
|
|
18
|
+
|
|
19
|
+
## Attribution
|
|
20
|
+
|
|
21
|
+
Adapted from the [Contributor Covenant](https://www.contributor-covenant.org/) v2.1.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Contributing to Cinch
|
|
2
|
+
|
|
3
|
+
Thank you for contributing. Every claim must cite a source. Every control must map to a threat.
|
|
4
|
+
|
|
5
|
+
## Principles
|
|
6
|
+
|
|
7
|
+
1. **Every claim must cite a source.** Checklist items, protocol steps, and mappings must reference a specific framework, standard, research paper, or published best practice.
|
|
8
|
+
2. **Enforceable over aspirational.** Prefer controls that can be verified by a checklist, test, or audit over vague guidance.
|
|
9
|
+
3. **Threat-to-control mapping.** Every control must map to one or more threats. If you add a control, identify the threat it mitigates.
|
|
10
|
+
4. **Architecture-level, not model-level.** Focus on environment, infrastructure, and process — not model alignment or prompt engineering alone.
|
|
11
|
+
|
|
12
|
+
## How to contribute
|
|
13
|
+
|
|
14
|
+
### Add or modify a checklist item
|
|
15
|
+
|
|
16
|
+
1. Edit the relevant YAML file in `checklists/`
|
|
17
|
+
2. Every item must include: `id`, `category`, `threat`, `control`, `severity`, `verification`, `sources`
|
|
18
|
+
3. Validate: `python3 -c "import yaml; yaml.safe_load(open('checklists/YOUR_FILE.yaml'))"`
|
|
19
|
+
|
|
20
|
+
### Add a protocol
|
|
21
|
+
|
|
22
|
+
1. Create or edit a Markdown file in `protocols/`
|
|
23
|
+
2. Follow the structure: Purpose → Scope → Prerequisites → Steps → Verification → Rollback
|
|
24
|
+
3. Reference checklist items by ID
|
|
25
|
+
|
|
26
|
+
### Add a skill
|
|
27
|
+
|
|
28
|
+
1. Create a directory under `skills/` with a `SKILL.md` file
|
|
29
|
+
2. Follow the Hermes Agent SKILL.md format (YAML frontmatter + markdown body)
|
|
30
|
+
3. Include trigger conditions, numbered steps, pitfalls, and verification
|
|
31
|
+
|
|
32
|
+
### Add a mapping
|
|
33
|
+
|
|
34
|
+
1. Edit or create the relevant YAML file in `mappings/`
|
|
35
|
+
2. Each mapping entry must include: `framework`, `control_id`, `framework_control_name`, `checklist_ids`, `description`
|
|
36
|
+
|
|
37
|
+
### Add a cross-harness config
|
|
38
|
+
|
|
39
|
+
1. Create or edit the config file in `cross-harness/`
|
|
40
|
+
2. Follow the existing format for the target agent (Claude, OpenClaw, NanoClaw)
|
|
41
|
+
3. Include all relevant CUSTODY pillars and checklist items
|
|
42
|
+
|
|
43
|
+
## Formatting
|
|
44
|
+
|
|
45
|
+
- YAML files: 2-space indent, keys in snake_case
|
|
46
|
+
- Markdown files: ATX headers, 80-char soft wrap
|
|
47
|
+
- File names: kebab-case (e.g., `agent-containment.yaml`)
|
|
48
|
+
- Checklist IDs: uppercase prefix + number (e.g., `AC-001`, `HE-006`, `RT-015`)
|
|
49
|
+
|
|
50
|
+
## Pull request checklist
|
|
51
|
+
|
|
52
|
+
- [ ] All YAML files validate
|
|
53
|
+
- [ ] Every new item cites at least one source
|
|
54
|
+
- [ ] Every new control maps to a threat
|
|
55
|
+
- [ ] No duplicate IDs within a file
|
|
56
|
+
- [ ] Commit message follows conventional commits format
|
|
57
|
+
|
|
58
|
+
## Code of Conduct
|
|
59
|
+
|
|
60
|
+
See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). Be respectful. Be precise. Cite your sources.
|