Agent Kung-fu: 10 Layers of Control Transfer for Production-Ready Agents

This article presents a 10-level framework for building production-ready AI agents, centered on six critical questions about action control, capability access, conflict resolution, failure handling, knowledge reuse, and causal reasoning, plus four engineering principles emphasizing code-enforced permissions, evaluator-driven loops, identification before optimization, and falsifiable innovation.

AI2ML AI to Machine Learning
AI2ML AI to Machine Learning
AI2ML AI to Machine Learning
Agent Kung-fu: 10 Layers of Control Transfer for Production-Ready Agents

Six Questions That Determine Production Readiness

The author argues that whether an agent can reach production depends not on a slightly stronger model, but on having answers to six fundamental questions:

Who decides the next action? — Control over the decision loop.

What capabilities can the model call? — Tool and skill boundaries.

When multiple participants disagree, who arbitrates? — Conflict resolution mechanism.

How does failure enter the next round instead of being silently ignored? — Explicit failure handling and retry logic.

How does experience precipitate into reusable knowledge? — Knowledge accumulation and reuse.

When can we only describe correlation, and when can we talk about causal intervention? — Distinction between observational and interventional reasoning.

Ten Layers, Ten Transfers of Control

The framework consists of ten layers; each layer transfers one more piece of control from the model to code, protocols, governance, feedback, data relationships, knowledge, semantics, causality, and finally to falsifiable experiments. The layers are not merely renamed chat scripts — they represent a progressive handoff of authority.

Ten layers diagram
Ten layers diagram

One Persistent Task: Top-5 Movie Categories by Revenue

The entire book uses a single, unchanging task: "Find the top 5 movie categories by revenue." What changes across layers is who controls the process. In Level 1, code handles fixed reading, connection, and aggregation; the model only submits a number N.

Four Core Principles (心法)

Prompt is a soft constraint. Permissions must be enforced at the code, sandbox, or database layer.
A loop without an evaluator is mere repetition; a loop without a stop condition is a risk amplifier.
Identify first, then optimize. Observing a difference does not automatically become an intervention effect.
Innovation must be falsifiable. A mechanism that cannot explain how it fails is not a testable solution.

How to Use This Material

90-Minute Quick Course

Run Levels 1–3 to observe how answer, tool, and trace change; then run Levels 4–5 to read evaluation feedback; finally rewrite the "conclusions" of Levels 9–10 into "identify gaps + experiments."

One-Day Engineering Workshop

Add a read-only account and timeout to the SQL guard; modify Level 4's action order, N, and skill summary; verify that all three cases are intercepted before execution; finally write a pre-registered inventory experiment plan.

Ten layers are not a leaderboard. Choose the lowest layer that is sufficient for your control needs.

Resources

Book PDF:

https://raw.githubusercontent.com/bibiparrot/agent_kungfu_levels/main/agent-kungfu-ten-levels-zh.pdf

Code repository:

https://github.com/bibiparrot/agent_kungfu_levels
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AI Agentsengineering practicesAgent architecturecausal reasoningagent evaluationproduction readinesscontrol layersfalsifiable experiments
AI2ML AI to Machine Learning
Written by

AI2ML AI to Machine Learning

Original articles on artificial intelligence and machine learning, deep optimization. Less is more, life is simple! Shi Chunqi

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.