Chensi — Advisory Safety Layer for AI agents: auto-generates repo context, command policies, and Claude Code deny-lists
Project description
Chensi
Advisory Safety Layer for AI agents. Run one command. Your AI agent gets an auto-generated repo map, typed command policies, and a
.claude/settings.jsondeny-list — without writing a single line of agent config.
Chensi is advisory, not a full enforcement layer yet. It generates structured context that Claude Code, Codex CLI, and other agents read at startup. Hard enforcement via preToolUse hooks is planned for Phase 5. See roadmap.
Meet Agenty 🤖 — Chensi's mascot, your repo's safety advisor.
Status
Branch studio — активная разработка Chensi v2.0.
| Версия | Статус |
|---|---|
| v0.1.0 | Released — markdown-only framework |
| v2.0 | In development — Python CLI, Phase 2 in progress (settings.json enforcement + PyPI release) |
Публичный релиз v2.0 будет на ветке main.
What Chensi does
chensi activate my-repo/
Result — your AI agent opens the repo and sees:
# Project Context (generated by Chensi v2.0)
Stack: python + langchain + langgraph + pandas + redis
## Safe commands
- pytest
- ruff check
- mypy src/
## Off-limits
- .env* (secrets)
- *.key (secrets)
- migrations/ (requires approval)
Plus a .chensi-os/adapters/claude/settings.json deny-list that Claude Code reads to physically block destructive commands:
{
"permissions": {
"deny": [
"Bash(rm -rf *)",
"Bash(git push --force*)",
"Bash(git reset --hard*)",
"Bash(chmod 777*)"
]
}
}
No manual config. No hand-written CLAUDE.md.
Quick start (v2.0 — dev build)
# Install
pip install -e .
# Activate repo
chensi activate path/to/your-repo
# Check results
cat path/to/your-repo/.chensi-os/adapters/CLAUDE.md
# Or with explicit output dir
chensi activate path/to/your-repo --output-dir /tmp/test --force
# Validate
chensi validate path/to/your-repo
What gets generated
.chensi-os/
├── adapters/
│ ├── CLAUDE.md ← Claude Code reads this
│ ├── AGENTS.md ← Codex CLI reads this
│ └── claude/
│ └── settings.json ← Claude Code deny-list (copy to .claude/)
├── project/
│ ├── architecture-map.md
│ └── boundaries.md
├── verification/
│ ├── commands.lock.yaml ← typed safe/ask/deny rules
│ └── commands.md
├── repo-profile.yaml ← detected languages, frameworks, test runners
└── boundaries.policy.yaml ← off-limits paths
Advisory vs Enforcement
| Layer | Phase | What it does |
|---|---|---|
| Advisory (CLAUDE.md / AGENTS.md) | Phase 1 ✅ | Agent reads context at startup — soft guidance |
| Deny-list (settings.json) | Phase 2 ✅ | Claude Code physically blocks listed commands |
| Hook interception (preToolUse) | Phase 5 🔜 | Runtime enforcement for all tool calls |
Phase 5 notice: Full hook-based interception is planned for Phase 5. Until then,
settings.jsonprovides hard blocking for Claude Code; advisory files handle all other agents.
Repository structure
.agent-os/ ← studio operational layer (Director, PM, PO, Engineering, QA)
template/ ← distribution template for users
.chensi-os/ ← what gets copied into the user's repo
.adapters/ ← Claude, Codex adapters
src/chensi/ ← Python CLI (Scanner → Analyzer → PolicyCompiler → ChensiLayer)
sandbox/ ← test repos for QA
targets/trading-agents/
.github/workflows/ ← CI (pytest + ruff, Python 3.11/3.12)
docs/ ← design document + business description
Platform support
| Platform | Status |
|---|---|
| Claude Code | Supported (CLAUDE.md + settings.json) |
| OpenAI Codex CLI | Supported (AGENTS.md) |
| Amazon Q Developer | Planned |
| Cursor | Planned |
Roadmap
| Phase | Description | Status |
|---|---|---|
| Phase 1 | chensi activate core pipeline |
✅ Done |
| Phase 2 | settings.json deny-list + PyPI v2.0.0 release | 🔄 In progress |
| Phase 3 | --policy-profile org flag |
Planned |
| Phase 4 | Windows support + test suite hardening | Planned |
| Phase 5 | Full hook-based interception (preToolUse) |
Planned |
| Phase 6 | Enterprise: OCI, Helm, SBOM, Artifactory | Planned |
License
MIT — see LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chensi-2.0.0.tar.gz.
File metadata
- Download URL: chensi-2.0.0.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
807612cf4cb5831d5a6683ba9403b03ce66cf0120c75a031cfc9cb3b18f3b8c3
|
|
| MD5 |
0792487d40fe4a8e6cd655d1856fd7c6
|
|
| BLAKE2b-256 |
42b3220c461e3476097fd37803916680bcfdf9ff8a01244a9c2b1a3261a7531a
|
Provenance
The following attestation bundles were made for chensi-2.0.0.tar.gz:
Publisher:
release.yml on Chensicorp/chensi-studio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chensi-2.0.0.tar.gz -
Subject digest:
807612cf4cb5831d5a6683ba9403b03ce66cf0120c75a031cfc9cb3b18f3b8c3 - Sigstore transparency entry: 1342663875
- Sigstore integration time:
-
Permalink:
Chensicorp/chensi-studio@ba32304d622c09d5a0c12ee9d8054c169f29e7f0 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/Chensicorp
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ba32304d622c09d5a0c12ee9d8054c169f29e7f0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file chensi-2.0.0-py3-none-any.whl.
File metadata
- Download URL: chensi-2.0.0-py3-none-any.whl
- Upload date:
- Size: 26.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f28014485ea3e3b4d1edb3aebd678da9bb0b389fd540bbea6bc142fd39c6394
|
|
| MD5 |
abd6dbc6a7a217c02da023c7becffa2c
|
|
| BLAKE2b-256 |
c1f386bd25c64e4dcd77639e6c9d47ad1904997406be61927d3d9c57a5f2637a
|
Provenance
The following attestation bundles were made for chensi-2.0.0-py3-none-any.whl:
Publisher:
release.yml on Chensicorp/chensi-studio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chensi-2.0.0-py3-none-any.whl -
Subject digest:
0f28014485ea3e3b4d1edb3aebd678da9bb0b389fd540bbea6bc142fd39c6394 - Sigstore transparency entry: 1342663885
- Sigstore integration time:
-
Permalink:
Chensicorp/chensi-studio@ba32304d622c09d5a0c12ee9d8054c169f29e7f0 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/Chensicorp
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ba32304d622c09d5a0c12ee9d8054c169f29e7f0 -
Trigger Event:
push
-
Statement type: