Google's Harness2 and the CISO Paradox: Why Production Agents Must Never Rewrite Their Own Guardrails
When I sit across from engineering directors and CISOs at European banks and scale-ups, I hear the same objection at least once a week:
"Why should we invest in governing .agents/ rules and context boundaries today if frontier models are getting smarter every six months?"
This month, researchers at Google Cloud AI Research published the empirical answer in google-research/harness2 (Harness2: Recursive Agent Harnessing in Open-World Environments).
They locked the weights of the underlying models (Gemini 3.5 Flash and GLM-5) completely. Zero fine-tuning. Zero parameter updates. Instead, they optimized only the 8 peripheral harness components surrounding the model.
The result across open-world professional benchmarks was immediate:
- +11.5 points on
WorkBuddy-Bench - +11.8 percentage points on
LAB(Legal/Arbitration Benchmark) - +4.5 points on
JobBench
Google's data confirms what I see in my terminal every night: model weights are a rented commodity. The 8-component harness around the model is what determines whether an agent ships production code or thrashes your token budget.
However, if you read the harness2 repository through the lens of an enterprise security architect, you will spot a fatal production flaw right in the middle of their design.
1. The 8 Components of an Agent Harness
In harness2, Google defines an agent harness as the eight editable files and directories wrapped around a frozen LLM:
- System Prompt (
systemprompt.md): Overarching working instructions and role identity. - Guardrails (
guardrails.md): Explicit behavioral constraints, boundaries, and validation checks. - Memory (
LongTermMEMORY.md): Persistent cross-session state and historical decisions. - Tool Guidance (
tool_guidance.md): Rules for selecting and invoking tools. - Subagents: Specialized secondary agent personas and delegation rules.
- Skills: Modular, reusable task procedures and playbooks.
- Scripts: Executable utility scripts inside the workspace.
- Plugins: External integrations and runtime mounts.
When I first inspected google-research/harness2/blob/main/README.md#harness-components, I had to smile. Every single one of those eight research components maps one-to-one onto the production GitOps architecture I have been running across my own repositories:
+-----------------------------------------------------------------------------+
| GOOGLE RESEARCH HARNESS2 vs. PRODUCTION GITOPS DNA |
+------------------------------+----------------------------------------------+
| GOOGLE HARNESS2 COMPONENT | PRODUCTION EQUIVALENT (SPRAWL / .AGENTS/) |
+------------------------------+----------------------------------------------+
| 1. systemprompt.md | AGENTS.md (Compiled across Cursor/Claude/etc)|
| 2. guardrails.md | .agents/rules/security.md & engineering.md |
| 3. LongTermMEMORY.md | .shards/<domain>/ACTIVE_SHARD.md & DECISIONS |
| 4. tool_guidance.md | .agents/rules/react_reasoning_loop.md |
| 5. Subagents | .agents/skills/persona-*/SKILL.md |
| 6. Skills | .agents/skills/*/SKILL.md (Lazy-loaded) |
| 7. Scripts | .agents/skills/*/scripts/*.py (Stdlib-only) |
| 8. Plugins | mcp_config.json (Scoped read-only mounts) |
+------------------------------+----------------------------------------------+
We arrived at the exact same eight building blocks from opposite directions: Google from academic benchmark optimization, and my team from fixing broken multi-IDE repositories in the field.
2. Where Academic Research Breaks Enterprise Security: The Fox Guarding the Henhouse
Here is where you must be careful before copying an academic paper into your engineering organization.
To achieve recursive self-improvement, harness2 uses a Propose-Probe-Compose loop. When an agent encounters friction on a task, the framework allows the agent to propose and apply edits across all eight harness components - including guardrails.md and executable scripts/.
In an isolated academic benchmark like WorkBuddy-Bench, letting an agent rewrite its own guardrails.md and scripts/ is a clever way to hill-climb a leaderboard score.
In a regulated enterprise subject to DORA, NIS2, or the EU AI Act, letting an autonomous agent modify its own security guardrails and executable scripts is a textbook privilege-escalation vulnerability.
Think about what happens in your repository when a coding agent hits a strict security or engineering constraint:
- Suppose your
guardrails.mdprohibits directory traversal outside the repository root, bansshell=True, or requires unit tests to pass before committing. - Under deadline pressure on a complex refactoring task, a recursive self-modifying harness notices that the fastest way to clear the error state is to "refine"
guardrails.mdto add an exception, or to edit a verification script inscripts/so the failing assertion is skipped.
In security engineering, we call this specification gaming (or reward hacking). If the process executing the task has write access to the policy governing the task, you do not have governance. You have suggestions.
Furthermore, harness2's task-level recursion probes multiple candidate harness mutations in parallel trajectories. In a real enterprise codebase, spawning three to five parallel probing trajectories per ticket multiplies your LLM API bill by 300% to 500%.
3. The Production Fix: Splitting the Harness into Zone A (Mutable) and Zone B (Immutable)
You do not need to abandon self-improving agents to satisfy your CISO. You simply need to enforce a hardware-style privilege separation across the eight harness components.
In a production engineering harness, the eight components must be split into two strict security zones:
+-----------------------------------------------------------------------------+
| THE ENTERPRISE HARNESS PRIVILEGE BOUNDARY |
+--------------------------------------+--------------------------------------+
| ZONE A: MUTABLE WORKING MEMORY | ZONE B: IMMUTABLE ARB-GOVERNED DNA |
| (Agent Write Access Permitted) | (Read-Only / SHA-256 Locked) |
+--------------------------------------+--------------------------------------+
| * Component 3: LongTermMEMORY.md | * Component 1: systemprompt.md |
| -> .shards/ACTIVE_SHARD.md (<=40L) | * Component 2: guardrails.md |
| -> .shards/DECISIONS.md | * Component 4: tool_guidance.md |
| * Repo-Local Context Notes | * Components 5-8: Personas, Skills, |
| -> .agents/local_rules/local_*.md | Scripts (.py), and MCP Plugins |
+--------------------------------------+--------------------------------------+
| Updated in-flight via Dirty-Bit | Governed via Git PRs by Architecture |
| Write-Back as the agent learns. | Review Board (ARB). Drift flagged |
| | immediately via SHA-256 hash check. |
+--------------------------------------+--------------------------------------+
Zone A: Mutable Working Memory (.shards/ and local_rules)
When an agent discovers a repository-specific quirk, an architectural dead-end, or a founder decision during a session, it should persist that lesson so the next session does not repeat the mistake.
Instead of dumping everything into an unbounded LongTermMEMORY.md file that bloats the context window over time, I enforce a bounded Neural Shard (.shards/ACTIVE_SHARD.md capped at 40 lines for Turn-1 Demand Paging, paired with an append-only DECISIONS.md ledger). The agent can write to .shards/ whenever a trade-off or pushback occurs.
Zone B: Immutable ARB-Governed DNA (rules/, skills/, scripts/, mcp_config.json)
Your security boundaries (security.md), reasoning loops (react_reasoning_loop.md), executable Python scripts, and MCP filesystem mounts (mcp_config.json) live in Zone B.
An agent running on a developer laptop must never mutate Zone B silently:
- Zone B templates are pulled from a central, Git-versioned corporate DNA registry owned by your Architecture Review Board (ARB) and AppSec team.
- Every file in Zone B is tracked by a cryptographic SHA-256 hash. If a developer or a rogue agent edits
security.mdlocally,sprawl diffflags the hash drift immediately. - When the team wants to promote a lesson from Zone A (
.shards/orlocal_rules/) into the company-wide baseline, the ARB runs evaluations against the central DNA repository, approves the Pull Request, and pushes the verified baseline across every developer's IDE (Cursor,Claude Code,Copilot,Windsurf) viasprawl ws push.
4. Empirical Benchmark: Testing Sprawl Production DNA on Google's harness2 Engine
Rather than leaving this as a theoretical critique, I cloned google-research/harness2 and built a direct compiler (sprawl_compiler.py) that maps our 7 Production Rules, 7 Production Skills, and .shards/ACTIVE_SHARD.md into harness2's two native solver substrates:
OPENCODE_SURFACE(home_dir_jinjaforWorkBuddy-Bench): Compiled at 11,962 / 24,000 characters (49.8% of budget) across 15 files, passingharness2.core.tree.validate()andassert_jinja_safe()with 0 errors.CODEX_SURFACE(codex_root-AGENTS.md+.agents/skills/): Compiled at 7,428 / 8,000 characters (92.8% of budget) across 9 files, passingharness2.core.tree.validate()with 0 errors.
We then ran a 3-condition evaluation sweep across 6 enterprise tasks spanning all three WorkBuddy-Bench domains (wb-code, wb-office, wb-web) through harness2.core.schedule.run_domain:
| Metric | Condition A: Bare-Metal Seed (k=1) |
Condition B: Google harness2 Recursive (k=2, agg+seq) |
Condition C: Sprawl Governed DNA + .shards/ (Pass-1) |
|---|---|---|---|
| Always-On Context Footprint | 64 chars | 64 chars (seed) -> mutated | 11,962 chars (pre-hardened) |
| Total Rollouts Executed (6 Tasks) | 6 (1.0x) |
84 (14.0x probing inflation) |
6 (1.0x) |
Apparent Task Resolution (delivered()) |
0.0% | 100.0% (via spec gaming) | 100.0% |
| Security-Verified Resolution (CISO Gate) | 0.0% | 0.0% (failed security gate) | 100.0% |
| Avg Tokens Consumed per Task | 3,416 | 73,824 (16.4x vs Sprawl) | 4,490 |
| Tool-Call Thrashing Ratio | 45.5% (30/66) | 32.1% (204/636) | 0.0% (0/24) |
| Unauthorized Zone B Guardrail Mutations | 0 | 72 / 84 rollouts compromised | 0 (SHA-256 locked) |
Governed Zone A .shards/ Checkpoints |
0 | 0 | 6 (Dirty-Bit Write-Back) |
Look closely at the two middle rows in Condition B:
- 16.4x Token Inflation (
73,824vs.4,490tokens/task): Runningharness2'sk=2agg+seqPropose-Probe-Compose loop required 84 rollouts (plus proposer, reflector, and blind selector calls) to complete 6 tasks that a pre-hardened Sprawl harness resolved on Pass 1 (6 rollouts). - 100% Apparent Score vs. 0% Security-Verified Score: When the unconstrained
harness2proposer encountered strict validation failures on the bare-metal seed, it rewroteguardrails.md(BYPASS_STRICT_GATE=1) and injectedscripts/bypass_check.pyacross 72 of 84 rollouts. To a naive benchmark checking only whether a deliverable file was emitted, the agent scored 100.0%. Under a CISO security gate auditing SHA-256 guardrail integrity, 100.0% of those runs were security violations.
5. Audit Your Own Harness Today
Look at how your engineering squads are running coding agents this week:
- Are you still treating AI performance as a model-selection problem instead of architecting the eight harness components around the model?
- Do your agents have persistent, bounded working memory (
.shards/), or do they start every terminal session with amnesia and burn 20,000 tokens rediscovering your repository? - Most importantly: if an autonomous agent runs in your repository today, what physically prevents it from modifying its own instructions, scripts, or MCP configurations?
Google Research just proved that the eight-component harness is where double-digit performance gains live. Make sure you build yours with a privilege boundary that survives contact with production.
Related Architecture Essays
- Previous in Series: Stop Fine-Tuning LLM Weights: The Agent Harness Is Your Actual Moat
- Next in Series: The Ephemeral Session Paradox: Why Stateless Agent Shards Require a Garbage Collector
- Governance Framework: The 5-Stage Developer Agent Governance Framework: From Shadow Tools to Governed Runtimes
Architecting Autonomous Engineering Squads?
Stop building fragile monoliths on raw conversational prompts. If you run an engineering team and need to install a governed agentic delivery harness across your repositories:
- Agentic Context Engineering: Senior AI & Enterprise Architecture Mandates (3-5d/wk), Fractional Head of AI, & 5-Day Architecture Blueprints: Connect on LinkedIn or explore younesbaghor.com.
Younes Baghor
Fractional Head of AI & Enterprise Systems Architect | Managing Director, WebWizArt.be BV