AI-Infra-Guard: Instructions file for Codex

AGENTS.md

AI-Infra-Guard AGENTS.md is an instructions file for Codex, OpenCode from Tencent/AI-Infra-Guard. It costs 998 tokens per session, scanned A, original, Apache-2.0.

Chinese-language project instructions for AI-Infra-Guard, a security-scanning platform for AI infrastructure. It combines Go services with Python scanners, security rules, databases, and Docker deployment files.

In plain words
What is it for?
Use them to build or run the Go service, start the agent, launch Docker services, and run the MCP, agent, or prompt-security scanners.
Why use it?
They explain the project's parts and local commands, helping an agent work in the correct language-specific component and start the needed services.

Instructions file for CodexOpenCode ✓ vendor

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is Tencent/AI-Infra-Guard's own configuration. It tells Codex and OpenCode how to work on AI-Infra-Guard itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything AI-Infra-Guard configures →

About the project

AI-Infra-Guard is an AI security red-teaming platform that scans agents, skills, MCP servers, and AI infrastructure and evaluates LLM jailbreak resistance. It is used to identify security risks and vulnerabilities in AI systems. Catalogue add-ons support its scanning and evaluation workflows.

Tencent/AI-Infra-Guard · 6,166 stars · on GitHub · tencent.github.io

Reuse

Borrowing it

Nothing to install: this file belongs to Tencent/AI-Infra-Guard. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Tencent/AI-Infra-Guard/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/Tencent/AI-Infra-Guard

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for AI-Infra-Guard AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/tencent/ai-infra-guard/agents-md.svg)](https://agentmods.dev/instructions/tencent/ai-infra-guard/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/tencent/ai-infra-guard/agents-md"><img src="https://agentmods.dev/badge/instructions/tencent/ai-infra-guard/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 998 This file is loaded in full into every session.
When invoked 998 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00998 $0.00998
Opus 5 $0.00499 $0.00499
Sonnet 5 $0.00200 $0.00200
Haiku 4.5 $0.00100 $0.00100

Measured 8d ago against content hash cd59cd69b1af, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

AI-Infra-Guard AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

项目定位

AI-Infra-Guard 是一个混合技术栈的 AI 安全扫描平台,核心由以下部分组成:

  • Go 主应用(Web 服务、CLI、任务管理、规则引擎)
  • Python 子模块(mcp-scanagent-scanAIG-PromptSecurity
  • 规则与知识库数据(data/fingerprintsdata/vulndata/vuln_endata/mcpdata/eval
  • Docker 部署编排(docker-compose.ymldocker-compose.images.yml

目录速览

  • cmd/cli:Go CLI 入口(scanwebserver
  • common/websocket:Web/API 服务与任务接口
  • internal/mcp:MCP 扫描与插件机制
  • pkg/:数据库、HTTP、漏洞结构等基础库
  • cmd/agent:Agent 进程入口(通过 WebSocket 接入主服务)
  • agent-scan/:Agent 工作流扫描框架(Python)
  • mcp-scan/:MCP 代码/动态扫描框架(Python)
  • AIG-PromptSecurity/:提示词安全评测组件(Python)

本地开发常用命令

Go 服务

# 构建主程序
go build -o ai-infra-guard ./cmd/cli/main.go

# 启动 Web 服务
./ai-infra-guard webserver --server 127.0.0.1:8088

# 或执行基础扫描
./ai-infra-guard scan -t http://127.0.0.1:8088

Agent 进程

go build -o agent ./cmd/agent
AIG_SERVER=127.0.0.1:8088 ./agent

Docker 启动

# 使用预构建镜像
docker-compose -f docker-compose.images.yml up -d

# 使用本地源码构建镜像
docker-compose up -d

Python 子模块

# MCP 扫描
pip install -r mcp-scan/requirements.txt
python mcp-scan/main.py --repo /path/to/project

# Agent 扫描
pip install -r agent-scan/requirements.txt
python agent-scan/main.py --repo /path/to/project --agent_provider /path/to/provider.yaml

# Prompt Security
pip install -r AIG-PromptSecurity/requirements.txt

测试与校验要求

必做校验(按改动范围执行)

# Go 单测
go test ./...

# YAML 规则格式校验(与 CI 保持一致)
go build -o yamlcheck ./cmd/yamlcheck
./yamlcheck data/fingerprints data/vuln data/vuln_en

说明

  • 修改 data/ 下规则时,必须通过 yamlcheck
  • 修改 API/任务结构时,需同步检查 api.mdapi_zh.mddocs/swagger.yaml
  • 修改 Python 子模块时,至少完成对应入口脚本的冒烟运行。

代码与提交流程约定

  • 优先做最小必要改动,避免无关重构。
  • 保持现有中英双语风格(注释/文档按周边文件风格保持一致)。
  • 不要提交敏感信息(API Key、Token、真实地址、日志隐私数据)。
  • 不要删除或覆盖现有规则库文件,除非任务明确要求。
  • 新增规则文件时,遵循现有目录与命名习惯。

安全注意事项(项目特性)

  • 当前 Web 平台默认不含完整鉴权机制,不应直接暴露公网。
  • webserver 监听非 127.0.0.1 地址会带来额外风险,需明确隔离环境。
  • 涉及扫描目标、附件上传、模型配置时,注意日志中不要泄露密钥。

CI/CD 关联约束

  • .github/workflows/yaml-lint.yml 会对 data/** 变更执行 YAML 校验。
  • 镜像发布由 .github/workflows/docker-publish.yml 管理。
  • Release 打包由 .github/workflows/create-release.yml 管理。

Read the full file on GitHub · 99 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 99 lines · 998 tokens per session scan A cd59cd69b1af

Subscribe to this mod's changes

AI-Infra-Guard AGENTS.md is an instructions file published in the GitHub repository Tencent/AI-Infra-Guard (6,166 stars, last pushed today), licensed Apache-2.0. It adds 998 tokens to every session, about $0.0050 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens