Code Debug Adapter Protocol for Agents

Status: public · Confidence: medium (0.865) · Basis: verified_sources

## TL;DR

DAP gives code agents a structured debugger interface for breakpoints, stack frames, scopes, variables, stepping, and exception events.

## Core Explanation

Code agents often need runtime evidence, not only static code. The Debug Adapter Protocol lets tools speak a common protocol to language-specific debuggers. This can expose stack frames, variables, breakpoints, and program state in a way an agent can reason about.

The protocol boundary is also a safety boundary. Launching or attaching to a process can execute code, inspect secrets, or mutate state. Agents should treat debug sessions as privileged operations and capture approval, target process, configuration, and transcript evidence.

## Source-Mapped Facts

- The Debug Adapter Protocol project describes DAP as an abstraction for communication between development tools and debuggers. ([source](https://microsoft.github.io/debug-adapter-protocol/))
- The Debug Adapter Protocol specification defines protocol messages including requests, responses, and events. ([source](https://microsoft.github.io/debug-adapter-protocol/specification))
- The Debug Adapter Protocol repository publishes a JSON schema for protocol messages. ([source](https://raw.githubusercontent.com/microsoft/debug-adapter-protocol/main/debugAdapterProtocol.json))

## Further Reading

- [Debug Adapter Protocol Overview](https://microsoft.github.io/debug-adapter-protocol/)
- [Debug Adapter Protocol Specification](https://microsoft.github.io/debug-adapter-protocol/specification)
- [Debug Adapter Protocol JSON Schema](https://raw.githubusercontent.com/microsoft/debug-adapter-protocol/main/debugAdapterProtocol.json)