ai-agent-utils
Workspace bootstrapper for repositories shared by humans and AI coding agents — shipping git-hook guardrails, claim-integrity gates, and Level-4 ai-sec-gate security verification out of the box.
Rules written in prose do not hold under long sessions or context compaction. Every boundary init-agent-project provisions is enforced mechanically by git hooks, pre-commit (ruff E9/F/B/S, gitleaks, ai-sec-gate), stdlib Python gates, and 40-char SHA-pinned GitHub Actions CI with a live Security Posture | Level 4 · verified badge.
Install
Install globally via uv (zero runtime Python dependencies):
# Run directly without installing:
uvx --from ai-agent-utils init-agent-project my-service
# Or install globally onto PATH:
uv tool install ai-agent-utils
Or install from source if you want to customize templates locally:
git clone https://github.com/rctruta/ai-agent-utils.git
cd ai-agent-utils
mkdir -p ~/.local/bin
ln -s "$PWD/init-agent-project.sh" ~/.local/bin/init-agent-project
Requires bash, git, python3 (>= 3.11 for stdlib tomllib in gates), and uv for Python workspaces. pre-commit runs the declared commit hooks; gh is optional for creating the GitHub remote, applying branch protection, and setting repository topics.
Usage
init-agent-project [OPTIONS] <project_name> [root_directory]
| Option | Effect |
|---|---|
--gates |
Full workspace with .gates/, .pre-commit-config.yaml (ruff, gitleaks, ai-sec-gate), AGENTS.md, scratch/ symlink, hooks, and Level-4 CI (default). |
--no-gates |
Skips .gates/ and pre-commit; keeps .githooks/pre-push, AGENTS.md, scratch/, and optional Python/CI setup. |
--lite |
Minimal workspace for quick prototypes or upstream issue reproductions: git init, .gitignore, minimal README.md, lightweight .githooks/pre-push (dirty tree, tracked .env, and gitleaks if installed), and optional Python uv venv. |
--python |
Provisions a Python pyproject.toml, uv environment, pytest, and Level-4 GitHub Actions CI without prompting. |
--lock |
Adds the optional same-tree agent-lock helper for two agents sharing one working directory (off by default). |
--owner <user> |
Sets the GitHub owner/org for generated README badges (auto-detected from GITHUB_OWNER, git config github.user, or gh api user). |
--portfolio |
Configures GitHub portfolio metadata (--description + portfolio topic + optional section topic; defaults remote visibility prompt to public). |
--description <text> |
Sets the one-line summary in README.md's opening prose paragraph, pyproject.toml, and GitHub's About description. |
--section <topic> |
Adds an optional GitHub topic slug (e.g., ai-security, ai-evaluation, benchmarking, data-engineering); implies --portfolio. |
-V, --version |
Prints the installed version and exits. |
-h, --help |
Prints usage and exits. |
Examples:
# Full agent-safe Python workspace with Level-4 security out of the box
init-agent-project --python my-service
# Portfolio-ready Python project with description and topic
init-agent-project --python --portfolio \
--description "Deterministic evaluator for agent memory graphs." \
--section ai-evaluation my-eval-tool
# Non-interactive throwaway or upstream issue repro
init-agent-project --lite --python issue-repro /tmp
What a seeded repository gets
| Path | What it does |
|---|---|
.githooks/pre-commit |
Runs pre-commit (ruff E9/F/B/S, gitleaks, ai-sec-gate semantic crypto/auth checks, AST/YAML/TOML checks, private-key detection) and the .gates/ checks on every commit. |
.githooks/pre-push |
Refuses a dirty working tree (including untracked files) and runs pytest / npm test when present. |
.gates/ |
Stdlib-only Python gates for claim integrity (verify.py, scan.py), hardcoded duplicates (no_hardcoding.py), dead modules (no_orphans.py), external scratch/ (scratch_external.py), script standards (check_script_standards.py), wheel hygiene (check_wheel.py), and publishing contracts (check_publish_contract.py). See GATES.md for the full registry. |
.pre-commit-config.yaml, .gitleaks.toml, ruff.toml |
Frozen 40-char SHA-pinned hooks (pre-commit autoupdate --freeze runs on bootstrap for ai-sec-gate), Bandit (S) linting, and home-directory path detection. |
scratch |
Symlink to a directory outside the repository ($AGENT_NOTES_ROOT/<project>, default ~/scratch/<project>). Git refuses to stage files through a symlink. |
.github/workflows/ci.yml |
Runs uv sync, pytest, .gates/ + prove_gates.sh, and uvx ai-sec-gate check . --prove --with-deps-audit --min-level 4 on PRs, pushes to main, and a weekly CVE schedule — publishing a live `Security Posture |
AGENTS.md, .claude/, .cursor/ |
Concise contract and editor adapters documenting the enforced rules. |
Gate engines in .gates/ are generic mechanism. Project-specific paths, thresholds, and exclusions are declared in pyproject.toml under [tool.gates.*] (or .gates.toml) and read with stdlib tomllib.
Limits
- Hooks do not clone. Anyone cloning a seeded repository must run
git config core.hooksPath .githooksonce per clone. - Local hooks are bypassable.
--no-verifyskips local hooks; GitHub branch protection requiring thetestCI status check is layer 2. - Private repositories on free GitHub plans do not support branch protection via the API; the initializer prints the exact command to run once eligible.
Verification & Runtime Overhead
Seeded repositories carry only lightweight, cached hooks; the ~20-second multi-repo generator suite (tests/ci_checks.sh) exists only inside ai-agent-utils itself to test the bootstrapper.
| Scope | Trigger | What runs | Warm runtime |
|---|---|---|---|
| Seeded repo | init-agent-project |
Workspace files, uv sync, initial commit (--lite is < 1 s) |
~2 s |
| Seeded repo | git commit |
Cached pre-commit (ruff, gitleaks, ai-sec-gate) + stdlib .gates/ |
~1 s |
| Seeded repo | git push |
Clean-tree check + the project's own pytest / npm test |
< 1 s + test suite |
ai-agent-utils only |
git push / CI |
tests/ci_checks.sh + pytest (wheel build + smoke install + 46 gate probes) |
~25 s |
pytest tests/ -q
bash tests/ci_checks.sh
License
Copyright 2026 Ramona C. Truta. Code and templates are licensed under the Apache License 2.0. Documentation (README.md, GATES.md, AGENTS.md) is licensed under CC BY 4.0.
Metadata
Release files for ai-agent-utils 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ai_agent_utils-0.5.1.tar.gz | 104.1 kB | Without provenance | Details for ai_agent_utils-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ai_agent_utils-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for ai_agent_utils-0.5.1-py3-none-any.whl |
Total release size: 183.5 kB
Release files / ai_agent_utils-0.5.1.tar.gz
| Download URL | ai_agent_utils-0.5.1.tar.gz |
|---|---|
| Size | 104.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a43975969e7360b8cf3e061ba77d2ba40b1693e9c209fa58b30bf4af572588b
|
|
BLAKE2b-256 checksum How to use checksums |
f5702c3316c87ba15f3b54c4675b6c63f469a0af24e56129259d736b0c7db55a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.13 {"installer":{"name":"uv","version":"0.13.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ai_agent_utils-0.5.1-py3-none-any.whl
| Download URL | ai_agent_utils-0.5.1-py3-none-any.whl |
|---|---|
| Size | 79.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
95bc63dcc9d4fdab2d950aaf964178cd0c880fd55bedc39ab0a1f5b1d4270669
|
|
BLAKE2b-256 checksum How to use checksums |
ea673b0be8894c44181279b7b01ebc86401bcd78cce5b07ecc5cebe8eb28dae5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.13 {"installer":{"name":"uv","version":"0.13.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for ai-agent-utils 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.