Ethics and Responsibility¶
AIfred Toolkit (aifred-tk) is designed to be a transparent and accountable bridge between AI agents and your local development environment. As AI agents increasingly participate in the software development lifecycle, it is critical to track their actions and ensure that every automated change is attributable to the specific model that produced it.
AI Governance & Attribution¶
The toolkit implements a governance layer that automatically tracks when a tool performs a persistent side effect (such as writing a file, creating a git commit, or calling an external API).
How it Works¶
- Change Flags: Every tool's
execute()method returns aToolResultobject. When a tool performs a mutation, it sets themade_changesflag toTrueand includes thellm_name(e.g.,openai/gpt-4o) of the agent that drove the change. - The Guard File: When the presentation layer (CLI or MCP server) detects a tool result with
made_changes=True, it appends the model identifier to a dedicated AI-assisted guard file. - Attribution: This log provides a persistent record of which models have "touched" the codebase, which can be used by pre-commit hooks, CI/CD pipelines, or security auditing tools to flag AI-generated content for human review.
Guard File Resolution¶
By default, the toolkit automatically detects the best location for the guard file:
- Git Repositories:
.git/commit-temp/ai-assisted. This is the preferred location for git-based projects, as it integrates with standard git workflows. - Non-Git Environments:
.aifred-tk/ai-assistedwithin the current working directory.
You can override this path in your configuration:
Transparency in the Loop¶
Attribution is only one part of the responsibility model. aifred-tk encourages "Human-in-the-Loop" (HITL) workflows through its Elicitation API.
- Explicit Confirmation: High-stakes tools (like the Conventional Commits plugin) are designed to ask for human approval before finalising a change.
- Auditable Logs: All tool executions, including their arguments and the resulting changes, are logged at the
DEBUGlevel to thelog_dirfor later inspection.
By combining automatic attribution with interactive confirmation, aifred-tk ensures that humans remain the ultimate authority over their codebase while leveraging the power of AI agents safely.