Agent-specific build profiles
Agent-specific build profiles are lightweight build configurations optimized for the agent iteration use case rather than the human pre-merge or release use case, and they now have to assume every agent is building in its own git worktree.
- Agent-specific build profiles exist (optimized for agent iteration patterns - fast feedback over comprehensive build)
- Build system understands agent iteration patterns and pre-caches likely next builds
- Any change gets build feedback in under 2 minutes
- Build profiles are auto-selected based on invoker (agent vs. human vs. CI)
- Pre-caching hit rate exceeds 70% for agent iterations
- Build duration dashboard showing sub-2-minute feedback for all change types
- Agent-specific build profile configuration
- Pre-cache hit rate metrics for agent iteration patterns
- Infrastructure L3 (Build System) - a dependency-graph build with shared cache and remote execution must be operational
- Delivery L3 (CI/CD Pipeline) - CI under 5 minutes required as baseline before sub-2-minute build targeting
What It Is
Agent-specific build profiles are lightweight build configurations optimized for the agent iteration use case rather than the human pre-merge or release use case. A standard CI build might run: linting, static analysis, unit tests, integration tests, documentation generation, test coverage analysis, artifact signing, and deployment packaging. An agent iteration build needs only: compilation succeeds, relevant unit tests pass. The rest is noise for iteration purposes and adds 8-15 minutes to a loop that should take 90 seconds.
The core insight is that different consumers of the build system have fundamentally different requirements. A release build needs everything: full test coverage, signed artifacts, generated documentation, security scanning, license compliance checks. A human pre-merge check needs most things: unit tests, integration tests, lint, static analysis. An agent iteration build needs the minimum signal to determine if the agent's last change was correct: does it compile, and do the tests that directly test the changed code pass?
Build profiles encode these different requirement sets as named configurations. In Bazel, this is a combination of .bazelrc configs and target selection. In Gradle, it's task profiles. In CI, it's separate workflow files or job conditionals that trigger different step sets based on the branch source. The key is that profiles are first-class build system concepts, not ad-hoc hacks - they're versioned, tested, and maintained with the same rigor as the main build configuration.
One assumption behind these profiles changed in August 2026: the profile can no longer assume a single checkout. Worktree isolation per agent stopped being something platform teams assembled by hand and became a vendor default - Meta's Muse Code, announced on 5 August, spawns its subagents in isolated git worktrees as standard behaviour. That is the right design for concurrency, and it moves the problem into the build system. Five agents in five worktrees is five source trees on one machine, each invoking your build, each with its own output directory unless you tell it otherwise. A profile tuned for one checkout will either duplicate every artifact five times or have five processes contend for one cache. Agent build profiles now need to be worktree-aware: a shared, content-addressed cache that all worktrees read from and write to, and output paths keyed per worktree so parallel builds do not corrupt each other. Multi-root workspace support in the editor is the same story one layer up.
The performance difference between a full build and an agent-optimized build profile can be dramatic. Teams moving from a 15-minute full CI pipeline to a 90-second agent profile see agents that can iterate 10x faster on the same infrastructure. This isn't magic - it's recognizing that the full pipeline runs steps that aren't useful for agent iteration, and explicitly not running them during iteration.
Why It Matters
- Agent iteration is fundamentally different from pre-merge validation - agents need fast confirmation of local correctness; full pre-merge validation is appropriate only when the agent believes a change is complete and ready
- 10-15 minute CI pipelines are acceptable for human pre-merge; they're catastrophic for agent iteration - with a full pipeline, agents can iterate 4-5 times per hour; with an agent profile, they can iterate 30-40 times per hour
- Skipping irrelevant steps improves signal quality - an agent profile that runs only affected tests has a clearer signal: pass means "the code I changed is correct," not "the code I changed plus 500 tests unrelated to my change are all passing"
- CI cost scales with build count - agent iteration generates many more builds than human development; an agent profile that costs 10% of a full build makes agent CI 10x more cost-effective per iteration
- Different profiles make quality standards explicit - defining what must pass for "agent iteration" vs. "human pre-merge" vs. "release" makes quality requirements concrete and machine-checkable
Getting Started
- Audit your current CI pipeline - List every step and categorize it: (a) required for release, (b) required for pre-merge human review, (c) required for agent iteration correctness, (d) optional/informational. Steps in category (c) and not (a) or (b) are candidates for exclusion from the agent profile.
- Define the agent iteration profile contents - Typically: compilation for changed targets and their dependents, unit tests for changed targets, lint for changed files only (not full lint). Explicitly exclude: integration tests, documentation generation, coverage reports, security scans, end-to-end tests.
- Create a
.bazelrcconfig for agent builds - Add abuild:agentconfig in.bazelrcthat sets--test_tag_filters=-integration,-e2e,-slowand uses--build_tests_only. Agents invoke Bazel with--config=agentto get the optimized profile. In CI, route agent-branch builds to a workflow that passes this flag. - Create a separate CI workflow file for agent iterations - In GitHub Actions, create
.github/workflows/agent-iteration.ymlthat triggers onagent/**branches. This workflow runs only compilation and unit tests, completes in under 2 minutes, and reports results immediately. Theagent/**branch naming convention routes builds automatically. - Run the full pipeline on agent PRs before merge - The agent iteration profile is for iteration, not for pre-merge validation. Before an agent-generated PR is eligible for merge, it must pass the full CI pipeline. Automate this: when a PR moves from
agent/draft to ready for review, trigger the full pipeline. - Make the profile worktree-aware - Assume several agents are building several worktrees of the same repository on the same machine at the same time, because vendor harnesses now spawn subagents that way by default. Point every worktree at one shared content-addressed cache so the second agent gets the first agent's artifacts, key output directories per worktree so concurrent builds cannot overwrite each other, and check that your build tool's lock behaviour degrades into queueing rather than failing. Verify by running the profile in four worktrees simultaneously and confirming the cache hit rate rises rather than the wall-clock time.
- Measure the profile's signal accuracy - Track how often a change that passes the agent iteration profile fails the full pipeline. If the failure rate is over 10%, the agent profile is too permissive and missing important checks. If it's under 2%, the profile is well-calibrated. Adjust which tests are included in the profile based on this failure rate.
Create a "pre-iteration check" profile even faster than the agent profile - just compilation, no tests. Agents can use this to verify that a change compiles before running the full iteration profile with tests. A compilation-only check that takes 10 seconds gives agents immediate feedback on syntax errors without the 90-second full iteration profile run.
Common Pitfalls
Making the agent profile so permissive that it doesn't catch real bugs. An agent profile that never fails doesn't help the agent know when it's made a mistake. Include at minimum the unit tests for the modules the agent is changing. A profile that always passes provides no signal.
Not automating profile selection. If agents need to manually specify --config=agent or remember to use the right CI workflow, they often won't. Automate profile selection: detect the branch name pattern (agent/*) in CI configuration and route to the agent profile automatically. Agents should never need to think about which build profile to use.
Letting the agent profile diverge from the full pipeline. If the agent profile runs different compilation flags, different test runners, or different code generation steps than the full pipeline, builds that pass the agent profile may fail the full pipeline for reasons unrelated to the agent's changes. Keep the agent profile as a strict subset of the full pipeline, not a different build.
Not versioning the agent build profile. Build profiles should be versioned in the repository alongside the code they build. If the agent profile is maintained separately from the main CI configuration, they'll drift apart and produce incorrect results. A single .bazelrc file or a single CI workflow file that both the agent profile and the full pipeline inherit from is the right structure.
A build profile that assumes one checkout per machine. Harnesses now isolate each subagent in its own git worktree by default, so the realistic local picture is several source trees building concurrently. A profile with a fixed output directory turns that into artifacts overwriting each other; a profile with no shared cache turns it into the same compilation performed N times. Neither shows up when you test the profile on your own single checkout, which is why the four-worktree test belongs in the profile's own validation.
Ignoring the CI cost of running the full pipeline on all agent PRs. If every agent draft PR runs the full CI pipeline, the cost savings from the agent iteration profile are eroded. Use CI triggers carefully: run the agent profile for every push to an agent branch, run the full pipeline only when the PR is marked ready for review or when a merge is requested.
How Different Roles See It
Bob's team runs 50 agent CI iterations per day and 30 human pre-merge CI runs. Each CI run takes 12 minutes. His CI cost is substantial. His infrastructure lead has proposed creating an agent-specific build profile that would cut agent CI time to 90 seconds. Bob is concerned that a reduced CI profile might miss bugs that the full pipeline catches.
What Bob should do: Bob should approve a 2-week experiment: run the proposed agent profile in parallel with the full pipeline for all agent branches. Compare results: how many agent builds pass the agent profile but fail the full pipeline? The expected failure rate is 3-7% for a well-designed agent profile - these are typically integration test failures unrelated to the specific change the agent made. Bob should set an explicit acceptance criteria: if the agent profile's false-positive rate (passes agent profile, fails full pipeline for a reason relevant to the agent's change) is under 5%, the profile is acceptable. This experiment provides the data Bob needs to make an informed decision rather than a gut-feel one.
Sarah has been tracking agent CI costs and sees that they're growing proportionally with agent adoption - each new developer adding agents adds a linear increment to CI costs. She wants to decouple agent adoption from CI cost growth.
What Sarah should do: Sarah should frame agent build profiles as a cost management strategy, not just a performance optimization. If agent CI can run for 10% of the cost of full CI, the cost-per-agent-iteration drops by 90%. This means the organization can support 10x more agent iterations for the same CI budget, or achieve the same agent throughput at 10% of the current CI cost. Sarah should model this: current CI cost per agent iteration, projected cost per iteration with a lean profile, breakeven point. This financial framing often moves faster through budget discussions than performance framing alone.
Victor has been running a custom agent build profile for 3 months. He has three profile levels: "quick" (compilation only, 8 seconds), "iteration" (compilation + changed-target unit tests, 90 seconds), and "full" (complete pipeline, 12 minutes). He's instrumented his agent workflow to automatically choose the right profile: "quick" for every push, "iteration" every 5 pushes or when the agent signals it wants test feedback, "full" before marking a PR ready for review.
What Victor should do: Victor should codify this three-tier profile system as a team standard. The key insight - that different stages of agent work need different feedback types - is generalizable. He should write the CI configuration so the three profiles are available to all agents and documented in the team's agent workflow guide. Victor should also track which agents use which profiles and how often: if agents rarely use the "quick" profile, it's not providing value; if agents frequently run "full" profiles during iteration (not just pre-merge), they're over-testing and wasting CI capacity.
Further Reading
From the Field
Recent releases, projects, and discussions relevant to this maturity level.
How This Guide Changed
What each edition changed in this guide, newest first.
- V1.6September 2026LATEST
Dropped the single-checkout assumption. Worktree isolation per agent stopped being something platform teams assembled by hand and started shipping as a vendor default, with Meta's Muse Code spawning its subagents in isolated git worktrees out of the box, which means the realistic local picture is now several source trees of the same repository building at once. The profile gained a worktree-aware requirement - one shared content-addressed cache across worktrees, output paths keyed per worktree, lock behaviour that queues rather than fails - plus a four-worktree validation test, because none of that failure mode is visible when you test the profile on your own single checkout.
- V1.0March 2026
The first edition carried this with a simple argument: the build a release needs, the build a human needs before merging and the build an agent needs after each edit are three different builds, and running the first in place of the third turns a ninety-second loop into a quarter of an hour. It asked teams to decide what minimum signal an agent actually needs - it compiles, the directly relevant tests pass - and to build a profile around exactly that.
Where does your team actually sit on this?
This guide describes one level of one area. Run the assessment to place your team across all 16 areas, see which gates you have passed, and get a report you can take to your stakeholders.