Skip to content

v0.33.0

Choose a tag to compare

@github-actions github-actions released this 17 May 19:13
· 55 commits to main since this release
d0d1591

New: Body Capture

The new body_capture transform records decoded request bodies of matching hosts onto the audit log as body_capture.request_body and body_capture.request_body_truncated fields. Useful for auditing the payloads passing through the proxy (such as the prompts a sandbox sends to an LLM provider) without modifying upstream traffic. Thanks to @elenaxzhao for the contribution.

max_request_body_bytes caps how much of each body is captured; bodies larger than the cap are truncated to the prefix and body_capture.request_body_truncated is set to true. The cap defaults to 16 KiB and is independent of the global proxy.max_request_body_bytes limit. The transform is observation-only: it never rejects a request, and body read errors are annotated on the trace rather than failing the request. Response bodies are not captured.

Note: Captured bodies are written to the audit log in plain text. When secrets runs with match_body: true, place body_capture before secrets so the audit log records the sandbox's proxy tokens rather than the real credentials secrets swaps in.

transforms:
  - name: body_capture
    config:
      max_request_body_bytes: 16384
      rules:
        - host: "api.anthropic.com"
          methods: ["POST"]
          paths: ["/v1/messages"]
        - host: "api.openai.com"
          methods: ["POST"]
          paths: ["/v1/chat/completions"]

Changelog

  • 388c995 feat(transform): add body_capture transform exposing decoded request bodies in audit log (#123)
  • d0d1591 refactor(transform): nest body_capture audit fields under a group (#124)