Skip to content

Commit 77f1458

Browse files
author
Mark Pollack
committed
Document what the SDK's logs can carry; guard Quarkus 16 MiB limits
The READMEs now say that a stdio agent's standard error is logged at INFO, unfiltered, on the agent-stderr logger and how to silence it, and that DEBUG and TRACE on com.agentclientprotocol.sdk log message payloads, session updates included. HttpTransportTest sends a 12 MB prompt over Streamable HTTP and WebSocket on Quarkus, above Quarkus's 10 MB default body size: a regression guard for the limits AcpHttpConfigBuilder raises.
1 parent 6a70ae1 commit 77f1458

7 files changed

Lines changed: 56 additions & 2 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6262
a failed `terminal/release` of a cancelled `execute`. Each now logs the error code and the SDK's
6363
name for it (`-32603 Internal error`); the peer's message and data are logged at DEBUG.
6464

65+
- **Documented: what the SDK's logs can carry.** A stdio agent's standard error is logged at INFO,
66+
unfiltered, on `com.agentclientprotocol.sdk.client.transport.agent-stderr`; silence it with that
67+
logger's level or `setStdErrorHandler`. DEBUG and TRACE on `com.agentclientprotocol.sdk` log
68+
message payloads, session updates included, and should not be enabled where logs are shipped.
69+
6570
- **A handler's unexpected exception no longer sends its message to the peer.** A request handler
6671
that failed with an exception other than `AcpProtocolException` was answered `-32603` with the
6772
exception's message, which can carry paths, SQL, URLs with credentials or tokens. It is now

‎README.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,20 @@ that authenticates in front. Browser requests whose `Origin` is not a loopback o
499499
| Streamable HTTP and WebSocket in your own Servlet 6 container | `StreamableHttpAcpClientTransport`, `WebSocketAcpClientTransport` | `StreamableHttpAcpServlet` (WebSocket where the container has Jakarta WebSocket 2.1) | acp-core / acp-http-servlet |
500500
| Streamable HTTP and WebSocket in a Spring WebFlux application | `StreamableHttpAcpClientTransport`, `WebSocketAcpClientTransport` | `AcpWebFluxHost` (a `RouterFunction`) | acp-core / acp-http-webflux |
501501

502+
#### Logging and sensitive data
503+
504+
Two of the SDK's loggers can carry message content or other sensitive data:
505+
506+
- **The agent's standard error.** `StdioAcpClientTransport` logs every line the agent process
507+
writes to standard error at INFO on the logger `com.agentclientprotocol.sdk.client.transport.agent-stderr`,
508+
unfiltered. An agent's diagnostics can carry sensitive data (paths, prompts, account details).
509+
Silence it by setting that logger's level to `WARN` or `OFF`, or route the lines yourself with
510+
`setStdErrorHandler`.
511+
- **DEBUG and TRACE.** At DEBUG and TRACE, loggers under `com.agentclientprotocol.sdk` log message
512+
payloads in full: the stdio client's sent and received lines, the sessions' messages, and the
513+
session updates the framework integrations log by default. Do not enable them where logs are
514+
shipped or retained.
515+
502516
---
503517

504518
## Building

‎acp-integration/README.md‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ AcpAgentDiscovery.requireSingle(candidates, "my.acp.agent.enabled").ifPresent(ag
110110
## The client
111111

112112
`AcpClients.async(transport, settings, customizers)` builds the one async client: capabilities,
113-
request and prompt timeouts, a session-update handler that logs at DEBUG, then the
113+
request and prompt timeouts, a session-update handler that logs each update at DEBUG, its content
114+
included, then the
114115
`AcpClientCustomizer`s in order. Building the client connects the transport (for stdio, it starts
115116
the agent process); a stdio command that cannot be started, or a transport already connected,
116117
fails the build. The ACP handshake waits for the application's `initialize()`.
@@ -119,6 +120,12 @@ fails the build. The ACP handshake waits for the application's `initialize()`.
119120
its timeout (`settings.closeTimeout()`); the framework must not close the client or its transport
120121
again through an inferred destroy method.
121122

123+
Logging: DEBUG and TRACE on `com.agentclientprotocol.sdk` log message payloads in full, session
124+
updates included; do not enable them where logs are shipped. A stdio agent's standard error is
125+
logged at INFO, unfiltered, on `com.agentclientprotocol.sdk.client.transport.agent-stderr`, and can
126+
carry sensitive data: set that logger to `WARN` or `OFF`, or register a handler of your own with
127+
`StdioAcpClientTransport.setStdErrorHandler`.
128+
122129
## Not here
123130

124131
The Mutiny `Uni` and `Multi` return types stay in `acp-quarkus`; the `CompletionStage` and

‎acp-micronaut/README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ class Updates implements AcpClientCustomizer {
132132
}
133133
```
134134

135+
Without a session-update handler of your own, session updates are logged at DEBUG, content
136+
included. DEBUG and TRACE on `com.agentclientprotocol.sdk` log message payloads in full; do not
137+
enable them where logs are shipped. A stdio agent's standard error is logged at INFO, unfiltered,
138+
on `com.agentclientprotocol.sdk.client.transport.agent-stderr`, and can carry sensitive data: set
139+
that logger to `WARN` in `logback.xml` to silence it.
140+
135141
| Property | Default | |
136142
|---|---|---|
137143
| `acp.client.request-timeout` | `60s` | |

‎acp-quarkus-deployment/src/test/java/com/agentclientprotocol/sdk/quarkus/deployment/HttpTransportTest.java‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ void oneMegabytePromptOverBothTransports() {
8383
roundTrip(new WebSocketAcpClientTransport(webSocketUri(), AcpJsonMapper.createDefault()), true, big);
8484
}
8585

86+
/**
87+
* The extension raises the Quarkus limits to the SDK's 16 MiB: a 12 MB prompt, above
88+
* Quarkus's 10 MB default body size, is accepted as a POST body and as a WebSocket message.
89+
*/
90+
@Test
91+
void twelveMegabytePromptOverBothTransports() {
92+
String big = "x".repeat(12 * 1024 * 1024);
93+
roundTrip(new StreamableHttpAcpClientTransport(endpoint, AcpJsonMapper.createDefault()), true, big);
94+
roundTrip(new WebSocketAcpClientTransport(webSocketUri(), AcpJsonMapper.createDefault()), true, big);
95+
}
96+
8697
@Test
8798
void connectionsLeftOpenAreCountedAndClosedAtShutdown() {
8899
roundTrip(new StreamableHttpAcpClientTransport(endpoint, AcpJsonMapper.createDefault()), false);

‎acp-quarkus/README.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ type in every framework integration. The client beans are created when first inj
136136
your own of the same type replaces each. Client callbacks run on SDK threads, not on a Vert.x
137137
context: from a `Uni` built over a client call, hop back with `emitOn` when you need the context.
138138

139+
Without a session-update handler of your own, session updates are logged at DEBUG, content
140+
included. DEBUG and TRACE on `com.agentclientprotocol.sdk` log message payloads in full; do not
141+
enable them where logs are shipped. A stdio agent's standard error is logged at INFO, unfiltered,
142+
on `com.agentclientprotocol.sdk.client.transport.agent-stderr`, and can carry sensitive data:
143+
`quarkus.log.category."com.agentclientprotocol.sdk.client.transport.agent-stderr".level=WARN`
144+
silences it.
145+
139146
## Configuration
140147

141148
Build time (fixed when the application is built):

‎acp-spring-boot-autoconfigure/README.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ class Ask implements CommandLineRunner {
136136
type in the Micronaut and Quarkus integrations) are applied to the client's builder in bean order.
137137
Register the session-update handler, the permission handler, and the file system, terminal and
138138
elicitation handlers there. Without a session-update handler of your own, session updates are
139-
logged at DEBUG.
139+
logged at DEBUG, content included.
140+
- **Logging.** DEBUG and TRACE on `com.agentclientprotocol.sdk` log message payloads in full; do not
141+
enable them where logs are shipped. A stdio agent's standard error is logged at INFO, unfiltered,
142+
on `com.agentclientprotocol.sdk.client.transport.agent-stderr`, and can carry sensitive data:
143+
set `logging.level.com.agentclientprotocol.sdk.client.transport.agent-stderr=WARN` to silence it.
140144
- **Capabilities.** The client advertises none by default. Turn one on with its
141145
`spring.acp.client.capabilities.*` property and register its handler in a customizer. A
142146
capability turned on without its handler fails the startup, naming the property.

0 commit comments

Comments
 (0)