# Code Bazel Build Event Protocol for Agents Status: public Confidence: medium (0.685) (verified) Last verified: 2026-06-03 Generation: ai_structured ## TL;DR Bazel Build Event Protocol data gives code agents structured build, test, and target evidence instead of requiring brittle log scraping. ## Core Explanation Repository agents working in Bazel monorepos need to know what targets were analyzed, built, tested, skipped, or failed. The Build Event Protocol exposes that information as structured events, which can be consumed by tools that summarize invocations, map failures to targets, and preserve artifacts for later inspection. The useful evidence includes invocation ID, command line, target pattern, configured target, action failures, test result events, output files, remote execution metadata, and whether events were written locally or published to a Build Event Service. This gives agents a stable route from a failing CI line back to a target and artifact. ## Source-Mapped Facts - Bazel documentation says the Build Event Protocol represents build information as events. ([source](https://docs.bazel.build/versions/main/build-event-protocol.html)) - Bazel documentation says the Build Event Protocol allows third-party programs to gain insight into a Bazel invocation. ([source](https://docs.bazel.build/versions/main/build-event-protocol.html)) - Bazel documentation describes the Build Event Service Protocol as a generic gRPC service for publishing build events. ([source](https://bazel.build/remote/bep)) ## Further Reading - [Bazel Build Event Protocol Documentation](https://docs.bazel.build/versions/main/build-event-protocol.html) - [Bazel Build Event Service Protocol](https://bazel.build/remote/bep)