ifixai-ai /iFixAi
Independent Auditing of AI Agents. Run by human or the agent itself, to answer the most crucial question in the AI Agent Economy. Is the agent doing what is supposed to do? With iFixAi you can have this answer in less than 120 seconds.
★ 44,493⑂ 1,788👁 472⑃ 382● 13▤ 23◈ 6
44,493
stars
+253
1,788
forks
472
watchers
382
prs
13
issues
23
releases
6
discussions
README
English · 简体中文 · 日本語 · 한국어
AI 运行偏差诊断工具
在问题失控之前,发现智能体的错误和盲区。
快速开始 • 测试你的智能体 • 你会得到什么 • 文档 • 参与贡献
怎样才能信任你的 AI 智能体?
你怎么知道它会按应有的方式完成工作,同时顾及你的整体业务:业务的意图、目标,以及组织里谁有权做什么?你又怎么知道,它不会去做没人要求、也没人授权的事?
正因如此,我们打造了 iFixAi:一个专注于智能体运营对齐与保障的独立审计工具。它把你的智能体放进一个模拟你业务的环境里,向它发送真实工作日里会遇到的各种请求,包括那些诱使它越出职责范围的请求,再由一个评审模型(judge)给每条回复评分。每一项发现都会写明被问了什么、你的智能体做了什么。
这类风险不只关乎网络安全、治理或合规中的某一方面,所以 iFixAi 的检查把 AI 红队测试、治理、保障和哲学结合在一起。
快速开始
一分钟就能看到效果。无需 API 密钥:它在一个内置的演示智能体上运行,回复和评分都是预设好的,让你在接入任何真实系统之前先看清整个流程。真正审计时,iFixAi 会从与你的智能体不同的提供商中挑选评审模型。你需要 Python 3.10 或更新版本(Mac 自带的 python3 是 3.9,请先用 python3 --version 确认)。在一个全新的虚拟环境中(python3 -m venv .venv && source .venv/bin/activate)运行:
bash
pip install ifixai
ifixai author reference -o reference.yaml
ifixai validate reference.yaml
ifixai run --provider mock --eval-mode self --fixture reference.yaml
这几条命令会为一个示例智能体(一家虚构金融科技公司的客服智能体,查看档案)构建模拟环境并完成校验,然后在演示智能体上运行默认的 10 项检查。评分卡会打印在终端里,报告保存在 ./ifixai-results/。
在 Windows 上,先运行 py -m venv .venv,再运行 .venv\Scripts\activate。如果找不到 ifixai,请改用 python -m ifixai.cli.main。
测试你自己的智能体
任何带有聊天端点的智能体都必须接受审计,而 iFixAi 都能审计。OpenAI 兼容的端点可以直接使用;其他端点只需要几行 Python 代码。任何模型都可以作为评审模型:OpenAI、Anthropic、Gemini、Azure、Bedrock、OpenRouter 等等。iFixAi 会根据你设置的密钥挑选一个,但绝不会选用你的智能体所用的提供商。
有两种运行方式。
借助编程智能体(推荐)
安装插件或 Skill,然后对你的编程智能体说 “用 iFixAi 审计我的智能体”。它会找到你的智能体,构建模拟环境,在产生任何费用之前先告诉你成本,然后运行审计,并解释审计结果。
插件(Claude Code 和 Codex)
在 Claude Code 中运行下面两条命令,然后直接提问,或输入 /ifixai:ifixai(如果没有出现,先运行 /reload-plugins):
/plugin marketplace add ifixai-ai/iFixAi
/plugin install ifixai@ifixai-community
已经装过?先运行 /plugin marketplace update ifixai-community,再运行 /reload-plugins,即可更新到最新版本。
Codex:在终端中运行下面两条命令,然后启动 Codex 并提问。之前装的是 ifixai@ifixai-ai?请参阅 plugin/README.md。
codex plugin marketplace add ifixai-ai/iFixAi
codex plugin add ifixai@ifixai-community
Skill(Cursor、VS Code、Windsurf、Zed 等)
bash
uvx ifixai install --agents cursor
然后在该编程智能体中输入 /ifixai-skill。把 cursor 换成 claude、vscode、windsurf、cline、continue、gemini、zed 或 all,即可装到其他编程智能体。更多说明见入门指南。
使用引导式 CLI
1. 描述你的智能体:把参考档案复制为 my-agent.json 并修改(怎么做)。也可以交给插件或 Skill:你的编程智能体会阅读你的智能体代码,替你写好档案。
2. 为你的智能体构建并校验模拟环境。安装你要用的评审模型对应的 extra:这里是 openai,也可以是 anthropic、gemini 等。
bash
pip install "ifixai[openai]"
ifixai author my-agent.json -o my-agent.yaml
ifixai validate my-agent.yaml
3. 用向导设置这次运行。它会询问你的智能体端点、评审模型和套件,找到评审模型的密钥,并把这些全部保存到 ifixai.yaml。然后传入你的智能体自己的令牌,在产生任何费用之前查看运行计划,再正式运行:
bash
ifixai setup
export AGENT_API_KEY=... your agent's own token
ifixai run --fixture ./my-agent.yaml --api-key "$AGENT_API_KEY" --dry-run
ifixai run --fixture ./my-agent.yaml --api-key "$AGENT_API_KEY"
--dry-run 会显示这次运行要做多少项测试、调用多少次评审模型,以及哪些检查不适用于你的智能体、原因是什么,然后停止。
写脚本或跑 CI 时更想用命令行参数?同样的运行只需一条命令。这个例子用 OpenAI 密钥来评审;如果用其他评审模型,请设置对应提供商的密钥。
bash
export OPENAI_API_KEY=sk-...
export AGENT_API_KEY=... your agent's own token
ifixai run --provider http --endpoint --api-key "$AGENT_API_KEY" --fixture ./my-aDiscussions
#390iFixAi is Repository Radar's Repository of the Month 🩺0 comments · 2026-11-02#366jonni1 comments · 2026-10-28#145thanks for updating1 comments · 2026-09-30#104Proposal: EvalPort adapter for ifixai.api.run_inspections() / TestRunResult3 comments · 2026-08-23#92iFixAi is featured in Repository Radar PR#40 (out tomorrow) 📡1 comments · 2026-08-11#43ask about projects1 comments · 2026-06-13
Latest release
V4.3.0 - Audit Any Agent Over Chat, Judging Within Budget & Guided Fixtures v4.3.0 2026-10-22Audit Any Agent Over Chat 15 inspections no longer need an adapter: B01, B02, B04, B23, C02, C05, C11, M02, M03, M07, P01, P08, V08, X04 and X11 each send a probe pack over chat, and the agent's replies decide the verdict (363). A chat endpoint is enough, and a bare model API counts. B01 and P01 grade a chat-only agent like any other. Hooks such as authorize_tool, get_confidence and route_to_human still work. They show as notes beside the probe results and never change the verdict. A check that can't apply to your agent is set aside before the run and never scored, and the report says wh