Files
kong-platform-llm/kong
Stéphane Tailland 11edfa8ed1 Capture request and response bodies on the AI gateway
The audit trail recorded metadata only for this gateway, so the prompts
sent to the LLM and the completions coming back — the one thing worth
auditing on an AI gateway — were never written down. The five business
domains have captured bodies since they were built; this gateway declares
its own copy of the observability plugins and never got them.

Adds the same pre-function/post-function pair the domains use, bound to
the proxy service, and the custom_fields_by_lua that reads them back in
the log phase. If the capture plugins are ever removed the fields go nil
and are silently omitted, so the log degrades to metadata rather than
breaking.

The response accumulator earns its keep here more than elsewhere: LLM
answers stream as SSE, so body_filter runs once per chunk and the
complete answer only exists after the last one.

Still dev-only, for the same reason as the rest of this file: it puts
prompt and completion content in the log stream.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-27 12:48:00 +02:00
..
2026-08-20 17:28:05 +02:00
2026-08-20 17:28:05 +02:00
2026-08-20 17:28:05 +02:00
2026-08-20 17:28:05 +02:00
2026-08-20 17:28:05 +02:00
2026-08-20 17:28:05 +02:00
2026-08-20 17:28:05 +02:00
2026-08-20 17:28:05 +02:00
2026-08-20 17:28:05 +02:00
2026-08-20 17:28:05 +02:00
2026-08-20 17:28:05 +02:00
2026-08-20 17:28:05 +02:00