Skip to content

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

  1. Change Flags: Every tool's execute() method returns a ToolResult object. When a tool performs a mutation, it sets the made_changes flag to True and includes the llm_name (e.g., openai/gpt-4o) of the agent that drove the change.
  2. 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.
  3. 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:

  1. Git Repositories: .git/commit-temp/ai-assisted. This is the preferred location for git-based projects, as it integrates with standard git workflows.
  2. Non-Git Environments: .aifred-tk/ai-assisted within the current working directory.

You can override this path in your configuration:

# ~/.config/aifred-tk/settings.yml
aifred_tk:
  ai_assisted_guard_file: "path/to/my/custom-log"

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 DEBUG level to the log_dir for 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.