Implementation Guide

    Adding tamper-evident audit logs to Kong AI Gateway

    A tamper-evident audit log does not stop someone from changing a record. It makes any change, deletion or gap detectable by a party who does not trust the gateway operators. For Kong AI Gateway, that means emitting a defined set of fields for every AI interaction, chaining and signing records outside the gateway's own trust boundary, writing them to write-once storage, and running verification independently. A gateway log still only proves what the gateway saw and recorded.

    Reference pattern: emit, protect, store, verify

    1. 1

      1. Emit

      Fixed schema, off-host delivery, alerts on delivery failure.

    2. 2

      2. Chain

      Each record hashes its content plus the previous hash.

    3. 3

      3. Sign and anchor

      Sign chain heads on a schedule and store them separately.

    4. 4

      4. Archive

      Write-once or immutable storage with retention set.

    5. 5

      5. Verify

      Independent recomputation, with failures reported outside the gateway team.

    Start with the threat model, not the log volume

    Standard logging plugins ship request and response records to storage that platform administrators can usually edit. That is the core weakness. NIST SP 800-209 describes tampering as an attacker deleting or modifying log data to prevent an effective audit trail, to conceal an attack, or to mislead investigators with false information. It also describes filling up logs first as a way to disrupt forensics.

    For a gateway, write down who can do each of these things and where. A gateway administrator can change plugin configuration so events are never emitted. A storage administrator can edit or delete records. A compromised host can forge entries. Anyone with network access can flood the pipeline until capacity runs out. Tamper evidence addresses alteration and deletion after the fact. It does not address events that were never emitted, which is why the emission design and the verification design have to be considered together.

    A useful test: if the person who runs the gateway wanted to rewrite last month's records, could an independent reviewer tell? If the answer depends on trusting that person, the log is not tamper-evident.

    Decide which events and fields to capture

    Define the record before choosing a mechanism, because integrity protection only covers what you emit. NIST SP 800-228 gives minimum telemetry for API protection: timestamp, client ID, request and response status, and an endpoint identifier. NIST SP 800-53 adds event descriptions, source and destination addresses, and the access control or flow control rules invoked.

    Mapped to an AI gateway, that gives you a practical field set, to be confirmed against what your Kong configuration actually exposes: a precise timestamp, the consumer or client identity, the route and upstream AI provider or model targeted, response status, the plugin decisions applied to the request (for example, a request rejected or modified), and a unique event ID with a per-writer sequence number. Add a record schema version so verifiers can parse old records years later.

    Be deliberate about payloads. Full prompts and responses can contain sensitive data, and a tamper-evident store makes them hard to remove. Many teams record a digest of the payload plus metadata in the audit chain and keep content, where needed, in a separate store with its own access and retention rules. The digest still lets you show that a retained payload matches what was recorded.

    Integrity mechanisms and their tradeoffs

    These techniques are complementary. Pick the smallest combination that gives an independent party a reliable verdict.

    • Per-file digests: Simple, and described in NIST SP 800-92 as storing a digest securely so changes to archived logs are detected. Coarse: it proves a file is unchanged, not which record changed or whether the file was complete when written.
    • Hash chaining: Detects modification, deletion and reordering of records within the chain. Requires serialized writes per chain, which limits throughput; use one chain per writer. Deleting the tail goes unnoticed unless the head is anchored elsewhere.
    • Digital signatures: Prove who produced a chain head. Add key management duties and signing cost, so sign batches rather than each record.
    • Immutable storage: Prevents overwrites and deletion during the retention period. It does not prove the original content was correct, so pair it with chaining.

    Keys, retention and verification

    Integrity depends on who holds what. Keep signing keys and stored digests outside the gateway administrators' reach, and give verification to a team or system that does not operate the gateway. NIST SP 800-92 stresses storing digests securely, and NIST SP 800-57 says all access to cryptographic keys, successful and failed, should be recorded in audit logs for periodic and emergency examination. Treat key access logs as audit data in their own right.

    Retention is an organization-defined decision, and NIST SP 800-53 requires storage capacity to be allocated to meet it, noting that insufficient capacity could cause loss or reduction of audit logging capability. Size for peak AI traffic, monitor capacity, and alert on abnormal volume, since flooding is a known way to push out useful records.

    Run verification on a schedule and after any incident. Recompute the chain, validate signatures, check that sequence numbers are contiguous, and compare record counts against gateway request counters from a separate source. Record each verification result, and route failures to someone other than the gateway operators. Periodic audits can then confirm that this procedure is actually followed.

    What a gateway log cannot prove, and where enforcement goes further

    State the limits plainly to auditors and to your own team. A gateway log shows what the gateway observed and chose to record. It cannot show traffic that bypassed the gateway, what an AI service did after receiving a request, or whether a record was emitted at all if emission was disabled. A hash chain shows records were not altered after chaining; it does not show they were accurate when written. Nothing here by itself establishes that a given interaction was permitted under policy, only that something was recorded about it.

    This is where enforcement in the execution path differs from a log pipeline. Trussed enforces policy inside the AI execution path, with decisions to allow, redact or block individual interactions and tool calls, and the audit-ready evidence is generated by that enforcement rather than reconstructed from a log afterwards. Evidence is mapped to HIPAA, NAIC, NYDFS, the EU AI Act and NIST, and deployment is self-managed in the customer cloud with configurable retention and data residency.

    The tamper-evident pattern above remains useful on its own. It strengthens the record of gateway traffic, and enforcement evidence addresses the separate question of what the AI was allowed to do.

    Tamper-evident pipeline

    Emit

    Send a fixed record for every AI interaction off the gateway host.

    Chain

    Link each record to the one before it with a hash.

    Anchor

    Sign and store chain heads where gateway admins cannot reach them.

    Verify

    Recompute the chain on a schedule, from outside the gateway team.

    Show what your AI was allowed to do, and what it did

    See how policy enforced in the execution path produces audit-ready evidence for a regulated enterprise.

    See How Evidence Is Produced
    Next step

    How does your AI governance program compare?

    See where your program has gaps in less than 2 minutes.