Skip to content

git — run safe git commands

git is a thin wrapper around the env’s shell that prepends git and rejects a small set of destructive patterns. The blocklist is hard-coded — the agent cannot disable it from the tool surface.

ArgTypeRequiredDescription
commandstringyesGit subcommand and arguments, e.g. status, add ., commit -m "msg".
PatternReason
push --force, push -fRewrite of shared history.
reset --hardDrops uncommitted work without prompt.
clean -f, clean -fdDeletes untracked files irreversibly.
branch -DForce-deletes branches.

When matched, the tool returns error="Blocked: 'git <pattern>' is not allowed for safety." and no command runs.

{"command": "status"}
from chimera.tools.git import GitTool
tool = GitTool()
result = tool.execute({"command": "log --oneline -5"}, env=local_env)
print(result.output)
8df78c3 docs(teams): refresh agent-teams.md ...
8b65604 docs(ollama,inspirations): document Path A ...
2234c91 fix(shrew,stoat): respect OLLAMA_HOST ...
  • The commit verb is allowed but the higher-level GitWorkflow is preferred for production use; it manages branches, diffs, and commit strategies.
  • For escapes from the blocklist, run bash directly with an explicit permission policy — there is no override.