Skip to main content

ai-agent-utils

CI Security Posture PyPI Release License: Apache 2.0 Docs: CC BY 4.0

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.

ai-agent-utils architecture: Workspace with external scratch symlink flowing through Layer 1 Local Git Hooks and Layer 2 Remote CI & Branch Protection to main

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 .githooks once per clone.
  • Local hooks are bypassable. --no-verify skips local hooks; GitHub branch protection requiring the test CI 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.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-agent-utils 0.4.0
File Size Uploaded Provenance Actions
ai_agent_utils-0.4.0.tar.gz 101.0 kB Without provenance Details for ai_agent_utils-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ai-agent-utils 0.4.0
File Interpreter ABI Platform Actions
ai_agent_utils-0.4.0-py3-none-any.whl Python 3 none any Details for ai_agent_utils-0.4.0-py3-none-any.whl

Total release size: 179.6 kB

Release files / ai_agent_utils-0.4.0.tar.gz

Download URL ai_agent_utils-0.4.0.tar.gz
Size 101.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6abc638e8317a997a9cf33575f8893878df148e429cb15b509c696d5dbc39679
BLAKE2b-256 checksum
How to use checksums
4c26312d94f4caf66f7fcc19df4b85ed24901f3a0cc3152db30e9ae289247c83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","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.4.0-py3-none-any.whl

Download URL ai_agent_utils-0.4.0-py3-none-any.whl
Size 78.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ceb46fcfbf573412e0ad4f7483ffcda5f4395d407ee60b1c302f6a25b7e7c706
BLAKE2b-256 checksum
How to use checksums
b2944a017e02ef7a9f8ba1925af22998720b1422f4237aa1927de6a6feeccc7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","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.4.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page