HomeClaude / Claude Code自己進化でも本体を勝手に書き換えない:AMA-terasのworktree隔離と岩戸ゲート

自己進化でも本体を勝手に書き換えない:AMA-terasのworktree隔離と岩戸ゲートAMA-teras isolates AI-generated self-improvement code in a git worktree and…

AI2 点サマリ2 key points
  • AMA-terasはAIが自己改善コードを生成する際にgit worktreeで隔離し、「岩戸ゲート」と呼ぶ承認ステップを経るまで本体リポジトリへのマージを禁止する設計を採用している。
  • これにより自律的な自己書き換えリスクを抑えつつ継続的な進化を可能にする安全アーキテクチャを実現している。
  • AMA-teras isolates AI-generated self-improvement code in a git worktree and requires an explicit approval gate before merging into the main branch.
  • This architecture enables continuous self-evolution while preventing unauthorized rewrites of the core system.

要約と収集メタデータをもとに生成した AI 解説本文です。元記事全文の転載・翻訳ではありません。This AI explainer is generated from the summaries and collected metadata, not from a reproduction or translation of the full source article.

AIが自らのコードを書き換えて能力を高める「自己進化」は、自律型エージェント研究の魅力的なテーマである一方、暴走や意図しない改変のリスクをはらむ。この課題に対し、AMA-terasと呼ばれるプロジェクトは、生成した自己改善コードをgitのworktreeで隔離し、「岩戸ゲート」という明示的な承認ステップを経なければ本体リポジトリへ反映できない設計を採用している。

git worktreeは、同一リポジトリから複数の作業ディレクトリを切り出せる標準機能で、ブランチを物理的に別フォルダとして展開できる。AMA-terasはこれを利用し、AIが提案する変更を本体とは分離した空間で生成・テストする。これにより、実験的なコードが即座にメインブランチへ流れ込むのを構造的に防いでいる。

「岩戸ゲート」という名称は、日本神話で天照大神が岩戸に隠れた逸話に由来すると見られる。ここでは、AIが生成したコードが本体へ統合される前に必ず通過しなければならない関門を指し、人間またはあらかじめ定めた基準による承認がなければマージが許可されない。いわゆるヒューマン・イン・ザ・ループを、リポジトリ運用のレベルで強制する仕組みといえる。

AMA-terasはAIが自己改善コードを生成する際にgit worktreeで隔離し、「岩戸ゲート」と呼ぶ承認ステップを経るまで本体リポジトリへのマージを禁止する設計を採用している。
🧡 Claude / Claude Code · 本記事のポイント

背景には、自律エージェントの能力向上に伴う安全性への関心の高まりがある。Claudeをはじめとする大規模言語モデルは、コード生成やツール操作を通じて複数ステップの作業を自動でこなせるようになりつつあり、AIが自身の動作を修正する構想も現実味を帯びている。一方で、権限管理や監査の仕組みが伴わなければ、意図しない変更が蓄積する懸念も指摘されている。

AMA-terasのアプローチは、特別なAI制御技術ではなく、バージョン管理の一般的な仕組みを安全境界として転用している点が特徴的だ。worktreeによる隔離と承認ゲートの組み合わせは、変更履歴が追跡可能で、問題があれば切り戻せるという利点も持つ。自己進化と制御可能性を両立させる一つの実装例として、同種の自律エージェント開発において参考になる可能性がある。

AMA-teras is an experimental autonomous-agent architecture, described in a Zenn blog post, that lets an AI model generate improvements to its own codebase while deliberately preventing that code from taking effect without a checkpoint. The project matters because it addresses one of the more difficult practical problems in agentic AI: how to allow a system to evolve continuously without letting it silently rewrite the core it is running on. Rather than treating self-improvement as a purely open-ended loop, AMA-teras frames it as a pipeline with a mandatory gate.

The central design choice is to separate where code is written from where code runs. When the agent produces self-improvement code, that code is committed into a git worktree instead of being applied directly to the main branch. In Git, a worktree is a standard feature that lets a single repository check out multiple branches into separate directories at the same time, each with its own working state but sharing the same underlying object database. This means an agent can experiment freely in an isolated directory, run tests, and iterate, all without touching the files that define the live system. If a generated change is flawed or unsafe, it stays quarantined in the worktree and never reaches the branch the running agent depends on.

The second component is what the author calls the "岩戸ゲート" or Iwato Gate, an explicit approval step that must be cleared before any worktree changes are merged into the main branch. The name references the Ama-no-Iwato myth, the heavenly rock cave from which the sun goddess Amaterasu emerged, fitting the project's broader mythological theming. Functionally, the gate acts as a human-in-the-loop or policy checkpoint: self-generated code accumulates on the isolated side of the gate, and only a deliberate approval action moves it across into the code that governs the agent. The stated goal is to keep continuous evolution possible while making unauthorized self-modification structurally difficult rather than merely discouraged.

This approach reflects a broader concern in AI safety about self-modifying or recursively self-improving systems. A recurring worry is that an autonomous agent granted write access to its own logic could alter its behavior, remove its own guardrails, or introduce regressions faster than an operator can review them. AMA-teras appears to address this not by forbidding self-improvement outright, but by controlling the merge path, which is the point where generated code becomes operative. Isolating changes in a worktree and requiring an approval gate turns a potentially unbounded loop into a reviewable series of proposals. It is worth noting that the security of this arrangement depends on the agent not having the ability to bypass the gate directly, for example by writing to the main branch through other means, so the enforcement boundary matters as much as the concept.

AMA-teras isolates AI-generated self-improvement code in a git worktree and requires an explicit approval gate before merging into the main branch.
🧡 Claude / Claude Code · Key takeaway

The design sits alongside a wave of coding-oriented agents and frameworks. Tools such as Claude Code, on whose ecosystem this project is based, along with SWE-agent, Devin, and various open-source AutoGPT-style loops, have made it routine for models to read repositories, edit files, and run commands. Git worktrees have separately gained popularity as a way to run several agent sessions or experiments in parallel without conflicting checkouts, so AMA-teras builds on an increasingly common pattern rather than inventing one. Related safety practices include sandboxing agent execution, restricting file-system and network permissions, and requiring pull-request review before merges, all of which aim to keep a deliberate boundary between what an agent proposes and what actually runs.

For readers evaluating the idea, a few prerequisites help. Understanding branches, merges, and worktrees clarifies why isolation is cheap and reversible in Git. Understanding the concept of human-in-the-loop control clarifies what the gate is meant to guarantee and what it cannot: a gate reduces the risk of unreviewed changes, but the quality of review still determines whether harmful code is caught.

As a design pattern, AMA-teras is a concrete, reproducible way to bound self-improving agents using existing version-control primitives rather than novel infrastructure. It is presented as an architecture rather than a formal safety proof, so its effectiveness likely depends on implementation details, the rigor of the approval step, and whether the isolation boundary holds under adversarial or buggy behavior. Still, the pattern of quarantine plus explicit approval offers a pragmatic template that other autonomous-agent projects could adopt.

  • 出典SourceZenn ClaudeコミュニティCommunity
  • 直近30件の平均重要度Avg importance, last 301=Info · 2=Medium · 3=High
  • 配信形式FormatブログBlog
  • 重要度Importance重要度 MediumMedium priority(Claude / Claude Code 169件中、同等以上 118件)(118 of 169 Claude / Claude Code entries are equal or higher)
  • 情報の寿命Half-life📘 中期 (チュートリアル)Medium-term (tutorial)
  • 原文言語Source languageJA
  • 収集日時Collected2026/07/19 18:43

本ページの本文と要約は AI による自動生成です。日本語版と英語版は言語ごとに独立して生成されるため、表現や詳しさが異なる場合があります。正確性は元記事 (zenn.dev) をご確認ください。The body and summaries are AI-generated independently for each language, so wording and detail may differ. Verify accuracy at the original source (zenn.dev).

🧡Claude / Claude Code の他の記事More from Claude / Claude Codeもっと見る →View more →