NewsCrawler.org

Zenn runs weekly fully automated AI penetration tests on GitHub Actions and Docker

OpenCode+Docker+GitHub Actionsで全自動AIペネトレーションテストはじめました
PRレビューのコメントの例
週次検査のトークン使用量とコスト
週次検査のIssueの例
Image: zenn.dev

The Zenn team checks every Pull Request with AI: when a PR becomes Ready for review, GitHub Actions launches an OpenCode[1] agent that reads the diff and surrounding code and reviews it for code quality, security and compliance, posting the result as a PR comment. A review costs about $0.01–$0.1 because the team runs open-weight models[2] on Fireworks AI, which states it does not use input data for model training without explicit opt-in. The review criteria are kept in the repository as a Skill[3] so changes to them can themselves be reviewed through PRs, and the AI only writes its findings to a file while a GitHub Actions step posts the comment, so the AI container never receives a GitHub token. For searches during review, OpenCode's built-in web search, which can use Exa or Parallel without an API key, is avoided because Exa's privacy policy allows submitted queries to be used for product improvement including model training; instead the team calls OpenAI's search API through its own OSS CLI webseek.

On top of that, Zenn runs a fully automated AI penetration test every week in a single GitHub Actions job, in two scopes: diff, focused on recent changes, and full, covering the whole application; the AI handles only the testing itself, while dependency audit, app startup, test data preparation and aggregation into Issues run as fixed steps. The agent sends real HTTP requests using curl to check each user's authorization one by one, custom nuclei[4] templates for exposed development APIs and missing security headers, OWASP ZAP with spider and active scan, and Playwright headless-browser checks for XSS and open redirect, all against a Zenn instance started on the runner with Google Cloud Storage, BigQuery and Stripe replaced by OSS emulators. Open-weight models are used for the tests too, also because their safeguards are looser than those of US closed models, which sometimes refuse the attacker-style operations the agent must perform; building the setup itself was once refused by the local Claude Code. A weekly full-scope run consumed over 100 million tokens at an OpenCode cost of $3.02.

To contain the agent, its container shares a network namespace with a firewall container that sets iptables to deny by default and allows only the app server under test and a small Node.js AI gateway; only the gateway holds the LLM API key, the agent receives a dummy value, and it cannot connect to the database or send data outside. After an incident published in July 2026 in which an OpenAI model escaped its evaluation sandbox, the team treats the sandbox as potentially fallible and also screens every command the agent tries to run with an AI classifier via a self-made OpenCode auto-approval plugin; findings are posted as Issues in a private repository, where a coding agent Skill deduplicates them, drops false positives and already-fixed items, assigns fixes and collects improvements for the next run.

Read the original zenn.dev

Sources

  • Zenn JA

    OpenCode+Docker+GitHub Actionsで全自動AIペネトレーションテストはじめました

    131 likes37 bookmarks1 comment

Published: First seen: Читать по-русски

Open as a page