aishield: Instructions file for Codex

AGENTS.md

aishield AGENTS.md is an instructions file for Codex, OpenCode from lm203688/aishield. It costs 1,308 tokens per session, scanned A, original, MIT.

A repository guide for AI coding agents working on AIShield, a tool that scans AI tools and instructions for security problems. It records the project's design, rules that must not be broken, and contribution steps.

In plain words
What is it for?
Use it when asking an agent to understand AIShield's architecture, preserve its security boundaries, run its checks, or update its documentation and code safely.
Why use it?
It gives an agent the context and safety rules it needs before changing code, reducing guesses and accidental violations. It also explains how to check that changes work.

Instructions file for CodexOpenCode

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

This is lm203688/aishield's own configuration. It tells Codex and OpenCode how to work on aishield 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 aishield configures →

Reuse

Borrowing it

Nothing to install: this file belongs to lm203688/aishield. 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/lm203688/aishield/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/lm203688/aishield

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 aishield AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/lm203688/aishield/agents-md/github.svg)](https://agentmods.dev/instructions/lm203688/aishield/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/lm203688/aishield/agents-md"><img src="https://agentmods.dev/badge/instructions/lm203688/aishield/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for aishield AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/lm203688/aishield/agents-md"><img src="https://agentmods.dev/badge/instructions/lm203688/aishield/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,308 This file is loaded in full into every session.
When invoked 1,308 The same file — it is already loaded in full.
Security scan A 1 finding. 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.01308 $0.01308
Opus 5 $0.00654 $0.00654
Sonnet 5 $0.00262 $0.00262
Haiku 4.5 $0.00131 $0.00131

Measured yesterday against content hash 0f22623c60f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-16, from the pricing page.

Security

Grade A, and why

aishield AGENTS.md scanned grade A with 1 finding 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 yesterday.

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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

匹配,绝不 `exec` / `os.system` / `subprocess` 被扫配置中的任何指令。
AGENTS.md · 80 lines

How it starts

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

AGENTS.md — Agent 原生项目手册(AIShield)

本文件供 AI 编码 agent(Claude Code / Codex / Cursor / AIShield 自身)直接读取。 目标:让 agent 在 不询问 的情况下理解架构、不变量与贡献约定。 借鉴自 heyclicky(farzaa/clicky)的 AGENTS.md 增长飞轮——早期 MIT 开源 + agent 可读文档,3 周冲到 7.5k stars。

这是什么

AIShield 是 Agent 原生 AI 工具安全扫描器:扫描 MCP server / skill / GPTs / prompt,对齐 OWASP MCP Top 10 (2025)OWASP Agentic AI Top 10 (ASI01–ASI10), 零第三方依赖、可 100% 离线运行。

  • 仓库入口:lm203688/aishield(public)
  • npm 包:aishield-mcp-server(v4.3.0,238 条规则 = 静态 210 + 情报 9 + 雷达 19)
  • 线上站:aishield.tools(Cloudflare Named Tunnel → VPS :8450api/server.py
  • 后端 API 前缀:/api/v1(注意:/api/health 会 404)

核心不变量(违背即 bug)

  1. 绝不 spawn 被扫配置里的命令。 扫描器把被扫内容当字符串读取、做正则/语义 匹配,绝不 exec / os.system / subprocess 被扫配置中的任何指令。 自证:python scripts/prove_isolation.py(拦截 subprocess/os.system,断言 0 次 spawn)。
  2. 代码与配置绝不上传云端。 本地优先、零依赖、可离线。
  3. 绝不引用过期规则计数。 真值以 /api/v1/healthrules_breakdown 为准; 改规则数必须同步 mcp-server/README.md 逐类表 + 跑 scripts/sync_readme_counts()。 勿引用 227/215/133/228 等历史数字。
  4. 本地测试绿 ≠ CI 绿。 推送走 scripts/_push_batch.py(Contents API,单提交), 推完必须 API 复验。
  5. 事件型告警必须能销案。 "本轮新增 N 条漏洞" 类告警不会自动恢复,零新增即 resolve; 不要把它当健康型告警只在恢复时 --resolve

架构速览

目录 / 文件 职责
api/server.py 后端 FastAPI 服务(/api/v1/audit/api/v1/handshake 等)
scanner/ 扫描引擎(engine.py 主入口 scan()rules.py 规则库;baseline_scan.py 基线漂移)
mcp-server/src/index.ts MCP server(调后端 API,渲染结果给 agent)
scripts/ 运维脚本:tech_radar.py(雷达)、promote_rule.py(规则晋升)、radar_effect.py(效果度量)、_push_batch.py(推送)
data/state/ 运行时状态(tech_radar.jsonradar_effect.json
.github/workflows/ CI/CD + 守夜 spine(cron 03:17)+ 独立 cron(self-heal/meta-monitor/stale)
tests/ Python 测试套件(tests/run_all.py 统一入口)

闭环四环节(落地必查)

检测 → 动作 → 验证 → 告警。任何新能力都要问:它在哪一步闭环?否则只是半成品。

一键启动(给 agent / 贡献者)

# 1. 克隆并准备
git clone https://github.com/lm203688/aishield.git && cd aishield
python -m venv .venv && source .venv/bin/activate && pip install pytest

# 2. 跑全量测试
python tests/run_all.py

# 3. 自证隔离不变量
python scripts/prove_isolation.py

Read the full file on GitHub · 80 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. yesterday Changed 0f22623c60f2
  2. 2d ago First seen · 80 lines · 1,308 tokens per session scan A 1798a801edb6

Subscribe to this mod's changes

aishield AGENTS.md is an instructions file published in the GitHub repository lm203688/aishield (2 stars, last pushed yesterday), licensed MIT. It adds 1,308 tokens to every session, about $0.0065 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-14.

Related

Other instructions, from other repositories

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 · 8,838 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,126 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

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,153 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