Sending promptfoo red team findings to Splunk

Export failed promptfoo red team results to Splunk through the HTTP Event Collector so the SOC can alert on and chart LLM security findings. This page covers the export step, token and index setup, and what reaches analysts.

On this page

Sending promptfoo red team findings to Splunk for SOC alerting

Security teams running promptfoo red teams often want failed attacks to show up in Splunk next to authentication logs, gateway logs and other telemetry the SOC already watches. promptfoo documents a way to do this: export the latest eval to JSON, transform the failures into HTTP Event Collector (HEC) events, and send them to Splunk. The documentation states that this works with Splunk Cloud Platform and Splunk Enterprise without a promptfoo-specific Splunk app. Treat it as a documented export path that you build and run yourself, not a native connector that promptfoo maintains as a Splunk product feature.

That boundary matters for ownership. The transform script, the scheduling, the HEC token handling and the retry behavior are your responsibility, so the export becomes part of your pipeline and needs the same review as any other integration. Confirm the current steps against the promptfoo Splunk integration documentation before you build, because the exact commands and output fields are defined there. Also confirm which promptfoo version your red team runs use, since the JSON structure you transform depends on it.

Decide early whether the SOC should receive every failed probe or a summarized set. A full red team run can produce many failures from a single plugin family, so a flood of similar events can bury real signals. Agree with the SOC on which plugins, severities and destination indexes matter for alerting, and keep the red team evidence store separate from production security logs unless your policy says otherwise. Ask your Splunk administrator to confirm the HEC endpoint, token scope and target index before any test data is sent.

What you need before the first event reaches Splunk

Five components have to be in place before a failed red team result can become a Splunk event: a working promptfoo install, a completed scan, a HEC-enabled Splunk instance, a token with a target index, and a network path from the runner. Confirm each one before you write the export step, because a gap in any of them shows up as a silent or rejected event.

Working promptfoo install

Install promptfoo on the machine or CI runner that will run the export. The npm release 0.124.1 requires Node.js 22.22.0 or newer, so check the Node version on that host first. Pin the promptfoo version in your pipeline so the JSON structure your transform script reads does not change between runs without you noticing.

promptfoo on npm

Completed red team run

The export reads the latest eval, so a red team scan must finish and write its results before the export runs. Confirm the scan completed rather than failed partway, since a partial run gives the SOC an incomplete picture. Record which target application and configuration the scan covered, because those fields will become the context your analysts need when they triage an alert.

Splunk instance with HEC enabled

Use Splunk Cloud Platform or Splunk Enterprise with the HTTP Event Collector turned on. Confirm with your Splunk administrator that HEC is enabled on the receiving instance or indexer tier, since it is often disabled by default in managed environments. No promptfoo-specific Splunk app is needed, so the work is configuration of HEC rather than installation of packages.

Splunk integration docs

HEC token and target index

Create a dedicated HEC token for promptfoo events and assign it a target index that the token is allowed to write to. Ask your Splunk administrator which index the SOC searches and whether it needs its own retention policy. Keep the token out of the repository and store it in your CI secrets store, since anyone holding it can write events into that index.

Network path and TLS settings

Confirm the runner can reach the HEC endpoint over the network, including any egress firewall, proxy or allow-list rule between the CI network and Splunk. Obtain the exact HEC endpoint URL and the TLS configuration from your Splunk environment, including which certificate chain the runner must trust. Test the connection with a single event before wiring the full export into a pipeline.

How to configure the export from promptfoo to HEC

This sequence moves failed promptfoo red team results into a Splunk index through HTTP Event Collector, so the SOC can alert on and chart them without a separate Splunk app.

  1. Run the red team and confirm the latest eval

    The security or platform engineer runs the red team scan against the target application with the promptfoo CLI, using the same config the team already reviews. Before exporting anything, confirm that the run finished and that the latest eval is the one you expect by listing recent evals in the local promptfoo store. Check that the results show the expected number of test cases and that the failure count matches what the run output reported. The step is complete when you can name the eval ID you will export.

  2. Export the latest eval to JSON

    Export the most recent eval to a JSON file with the promptfoo CLI, writing the file to a location the export job can read, such as a build workspace or a dedicated directory on the scanning host. Keep the file name tied to the eval ID or the pipeline run so that a later investigation can match a Splunk event to the scan that produced it. Open the file and confirm that it contains the results array and that each result has a pass or fail status. The step is complete when the JSON file parses and holds the results from this run only.

  3. Transform failed results into HEC event objects

    Write or adapt a small script that reads the exported JSON, keeps only the failed results, and wraps each one in a HEC event object. Each event carries the event payload plus the sourcetype, index and source fields that Splunk uses for routing and searching. The promptfoo Splunk documentation describes this transformation approach, so follow it and keep the field names consistent across runs. Ask the engineer who owns the script to document which result fields become the event body, because the SOC will search on them. The step is complete when a dry run prints event objects for known failures and prints nothing for a passing run.

  4. Create the HEC token and target index

    A Splunk administrator creates a dedicated index for promptfoo findings and an HTTP Event Collector token that is allowed to write only to that index, with the sourcetype the script sets. Store the token in the pipeline's secret store rather than in the script or the repository. Confirm the HEC feature is enabled for the Splunk Cloud Platform or Splunk Enterprise deployment and that the token is listed as enabled. Ask the Splunk team to confirm their retention and access settings for the new index before any production data is sent. The step is complete when the administrator confirms the index name and the token is available to the export job.

  5. Send a single test event

    Send one hand-written event with the same sourcetype, index and source values the export uses, through the HEC endpoint with the new token. Use a clearly labeled test payload, such as a message stating that it is a connectivity check, so that it cannot be mistaken for a finding. Search the chosen index in Splunk for that test string and confirm that the event appears with the expected sourcetype and source. If it does not appear, check the token's allowed indexes and the HEC endpoint response before going further. The step is complete when the test event is searchable in the target index.

  6. Export a real run and verify the event fields

    Run the full chain on an actual red team scan that is known to contain failures, then search the index for events from that run. Compare the number of events in Splunk with the number of failed results in the JSON file, and check that each event contains the fields the SOC plans to use for filtering. Repeat the export on a scan with no failures and confirm that it sends no failure events to the index. The step is complete when the event counts match and the passing run produces zero new failure events.

  7. Schedule the export after each scan

    Add the export as a step that runs after each red team scan in the pipeline or scheduler the team already uses, so that it reads the latest eval each time and never a stale file. Keep the HEC token in the secret store and make the job fail visibly when Splunk rejects an event, so that a dropped export does not look like a clean scan. Agree with the SOC which searches, alerts and dashboards will use the index, and confirm the alert conditions in a test. The step is complete when a scheduled run produces the expected events in Splunk and a failed export is reported to the team.

How failed results become HEC events

The export step has three moves: read the latest eval as JSON, keep only the failed red team results, and wrap each failure in an HTTP Event Collector event envelope before sending it to Splunk. The promptfoo Splunk documentation describes this pattern and confirms it works with Splunk Cloud Platform and Splunk Enterprise without a promptfoo-specific Splunk app, so the transformation is a script you own and run, not a connector you install. Before you build it, open the promptfoo Splunk guide and copy the exact field names and envelope layout it uses. This page does not restate them, and your parser and Splunk searches should match that schema exactly, including any version differences you find when you check the documentation for your release.

A failure record should carry enough context for a SOC analyst to act without opening the tool. Expect to include the plugin or category that flagged the failure, the attack strategy that produced it, the severity if the export provides one, the target or application name, a timestamp, and a reference back to the eval so an analyst can reopen the full result. Keep the reference stable across runs so repeated failures can be correlated. Ask your team which of these fields the schema actually provides and which you must derive, because a missing severity or target name is a gap you need to fill in the transform, not a field to invent in Splunk.

Prompts and model outputs from red team runs often contain the sensitive material the test was looking for, such as account data, personal details or internal instructions a model leaked. Once an event reaches the HEC endpoint, that content is indexed, searchable and usually retained under your Splunk retention settings, so redaction belongs in the transform on the runner, before any HTTP request is made. Decide with your privacy and security leads which fields are sent in full, which are masked and which are dropped, then test the transform against a sample failure that contains realistic-looking but synthetic sensitive values and confirm none of them appear in the event payload.

Mapping promptfoo fields to Splunk event fields

This table maps each red team result attribute to a Splunk event field and marks whether the export script sets it or your team must decide it. Use it to plan the transform step and the naming rules before alerts and dashboards depend on them. The final field list must be confirmed against your own export output, since the names your script emits are what Splunk will index.

FieldSet byNotes
Eval or run identifierExport scriptTaken from the latest eval JSON; use it to group all failures from one red team run.
Red team pluginExport scriptIdentifies the vulnerability category tested, so alerts can filter by risk type.
Red team strategyExport scriptRecords the attack delivery method used for the probe, such as the jailbreak or encoding strategy.
Pass or fail statusExport scriptOnly failed results are sent as events; confirm the status value your export emits.
Target applicationExport scriptNames the application under test, so SOC searches separate one system from another.
TimestampExport scriptConfirm which time is written, the eval run time or the export time, and map it to Splunk's event time.
IndexYour teamChoose a naming convention for the index that holds AI red team events and set it on the HEC token.
SourcetypeYour teamDefine one sourcetype for search and alert rules so field extractions stay consistent across runs.
SourceYour teamSet the source value to identify the promptfoo export pipeline in searches and audits.

HEC token and index choices by environment

Development and test red team runs produce large volumes of findings against prompts and endpoints that are still changing. Those findings are useful to engineers, but they are rarely a reason to page the SOC. Sending them to a dedicated token and index keeps dashboards and alerts built for production scans from being distorted by test traffic, and it lets the team clear or shorten that data without touching security records.

  • Dedicated token: Create a separate HEC token for non-production runs so its activity is visible and can be disabled without affecting production ingestion.
  • Separate index: Point the test token at a non-production index so searches and alerts scoped to production stay clean.
  • Shorter retention: Set retention for the test index according to engineering needs, not the security retention schedule, and confirm the setting in your Splunk version.
  • No alerting by default: Keep saved searches that page on-call limited to the production index, and let test dashboards serve engineers.
  • Synthetic data labels: Tag events with the environment and run identifier so anyone reading an event can tell test traffic from production scans.

Before go-live, confirm with your Splunk administrator which token settings and index options your version exposes, and check that no test token can write to a production index.

Data flow from promptfoo runner to the SOC

The flow starts on a CI or scheduled runner that executes the red team scan and writes the latest eval to JSON. A transform step keeps only the failed results and shapes them into HEC events. The events cross the trust boundary to the Splunk HEC endpoint, where the Authorization token is checked and events land in the target index. Alerts and dashboards read from that index. Check the token scope, the index permissions and what the transform removes before the first events are sent.

Failed red team results flow from the runner through HEC into a Splunk index consumed by the SOC.

Securing the HEC token and the data in transit

The export step moves red team results, which contain adversarial prompts and model responses, out of promptfoo and into Splunk. Each control below narrows what a leaked token, an intercepted request or a noisy runner log could expose. Confirm each one against your own Splunk access model before the first production export.

Scope the HEC token tightly

Create a dedicated HEC token for this export only, not a shared ingest token used by other sources. Restrict it to the one index the SOC uses for AI security findings and disable any default index it could fall back to. Review who can view and rotate the token in Splunk, and record the owner so a rotation after a staff change is not missed. Confirm the token settings with your Splunk administrator, since the available options depend on your deployment.

Splunk integration docs

Keep the token out of the repository

The HEC token should reach the export job through the CI system's secret store or an external secrets manager, never as a literal in a promptfoo config, a script or a committed .env file. Mask it in job logs and limit which branches and environments can read it, so a pull request from a fork cannot print it. Plan a rotation procedure that updates the secret in the store and the Splunk token together.

Require TLS to the HEC endpoint

Send events only to an HTTPS HEC endpoint and verify the server certificate on the runner rather than disabling verification to get a working connection. Confirm which hostname and port your Splunk Cloud Platform or Splunk Enterprise deployment exposes for HEC, and whether the certificate chains to an authority your runner trusts. Traffic from the runner should cross only the network path your security team has approved.

Limit forwarded prompt and response content

A failed red team result usually contains the adversarial prompt and the model's reply, which can echo sensitive data from the application under test. Decide which fields the transformation step keeps, such as plugin name, strategy, severity, pass or fail status and a finding reference, and drop full transcripts unless the SOC needs them. Test the transformation with a sample result that contains a planted secret to confirm it does not reach Splunk.

Grant least-privilege index access

Set read permissions on the destination index to the roles that triage these findings, and keep administrative roles separate from analyst roles. Do not rely on the promptfoo instance for access control: the self-hosted app stores data in a local SQLite database without RBAC or built-in SSO, so anyone who can reach that server could read results there. Treat Splunk role mapping as the access boundary for exported findings and confirm it with your own identity team.

Harden the runner and its logs

Check that the CI job does not echo the export payload, the HEC request headers or the environment to build logs, and that debug flags are off in the export step. Set a short retention on runner logs and artifacts that contain exported JSON, and delete the intermediate results file after the job completes if it is not needed for audit. Ask your CI platform team how runner logs are stored and who can read them.

What reaches the SOC and what does not

Analysts will see the failed red team results you choose to export, not the full eval transcript. The export step described in the Splunk integration converts failures into HEC events, so the SOC receives one event per failed test with the fields you map, such as the target, plugin category, strategy and a link back to the eval. Prompts, model responses and full conversation logs stay in promptfoo unless you deliberately add them to the event payload. Before the first production export, decide which fields are necessary for triage and review the payload with your privacy and data protection owners, because adversarial prompts can contain sensitive test data and model outputs can echo it back.

Build two saved searches on top of those events. The first is an alert on failure counts per target, set to fire when the number of failed events for one configured application exceeds a threshold you agree with the owning team, so a sudden jump after a model or prompt change is visible. The second is a dashboard of failures by plugin category, which shows whether failures cluster around prompt injection, data exposure or another class. Keep the link back to the eval in every event so an analyst can open the run in promptfoo and inspect the failing test. Confirm in your own Splunk environment how your chosen index and sourcetype behave with these alerts before you rely on them.

A red team failure is a finding against a configured target, produced by a test run, not evidence of a production incident. A failed probe may reflect a gap in a test environment, an intentionally permissive staging configuration or a true weakness, and the SOC cannot tell these apart from the event alone. Assign an owner for each finding class, such as the application team for prompt injection or the data platform team for data exposure, and write triage rules that say who acknowledges an alert, who decides whether it is a finding, and when it is escalated to incident response. Without those rules, a scheduled scan can create recurring alerts that the SOC treats as noise or as an active attack.

Common failures when events do not reach Splunk

Why are no promptfoo findings showing up in Splunk after a successful export?

The most common cause is that the HEC input is disabled or the export is posting to a different host, port or endpoint than the one Splunk is listening on. Confirm that the HEC input is enabled in Splunk, that the token is attached to that input, and that the export URL points at your HEC endpoint rather than the Splunk web interface. Then send a single test event with a manual request and search for it by a unique value you put in the event, such as a run ID. Check the index and time range in the search as well, since a search scoped to the default index or the last few minutes will miss events sent elsewhere.

  • Check that the HEC input is enabled and the token is assigned to it.
  • Check the scheme, host and port used by the export step.
  • Search for a unique test value across all indexes and a wide time range.
Why does Splunk return authentication errors when the export posts to HEC?

Authentication errors usually mean the token value is wrong, the token has been disabled or deleted, or the request does not send the token in the format HEC expects. Check that the token is copied exactly, that it is stored in your CI or secrets store and not hard-coded, and that the token's allowed indexes include the index your export writes to. A token that is valid but not permitted to write to the target index will also fail, so review the token's index settings alongside its value. Splunk's own HEC documentation describes the authorization header format and token settings; compare your request against it before changing anything else.

Why do promptfoo findings land in the wrong Splunk index?

The index is set either in the HEC token's default settings or in each event, and an event-level index that does not exist or is not allowed for the token can cause events to go to an unexpected place or be rejected. Confirm which index your transformation step writes to, confirm that the index exists on the Splunk instance you are posting to, and confirm that the token allows it. Also check whether a default index on the token overrides what you expected. Agree the index name with the SOC before the first export so dashboards and alerts reference one stable name.

Why do duplicate promptfoo events appear after the export runs again?

Duplicates appear when a rerun resends the same failed results as new events, because a plain HEC post has no built-in deduplication. The export step needs its own identifier per finding, such as a stable hash of the run ID, plugin, strategy and test case, so that repeated sends can be recognized in searches or skipped before posting. Without that key, a scheduled job that re-exports the latest eval will repeat the same findings each time. Ask whether your export design defines a stable event key and whether downstream alerts are written to tolerate repeats, for example by counting distinct keys rather than raw events.

Why are promptfoo fields not extracted for searches in Splunk?

Fields are not extracted when the event is sent with a sourcetype that Splunk does not parse as you expect, when the JSON structure differs from what the search assumes, or when the transformation writes values under different key names across runs. Check the sourcetype on a sample event, compare the key names in the raw event with the field names in your searches, and confirm that the JSON is valid and consistently shaped. If the sourcetype is new, define its field extraction settings or use a sourcetype that matches the event shape. Keep the key names in the transformation stable, because renaming a key breaks every saved search and dashboard built on it.

Why do promptfoo events arrive with the wrong timestamp?

Events get the wrong time when the export does not send a timestamp and Splunk uses the receive time, or when the timestamp format and time zone in the payload do not match what Splunk parses. Check whether the event includes a time value, confirm its format and time zone, and compare the event time with the time the eval actually ran. Wrong timestamps can make a correct finding fall outside an alert window or a dashboard time range, so verify this with a test event before you tune alert schedules.

What should the SOC check first when a promptfoo alert does not fire?

Start by confirming that the event exists in the expected index, then check that the alert's search matches the event's sourcetype, index and field names. An alert can be correct and still never fire if it searches a field that was renamed, a sourcetype that was never used, or a time window that excludes the run. Ask the team that owns the export to document the event schema, the index, the sourcetype and the event key, so the SOC can test alerts against known sample events. This is a planning point to confirm in your environment, since alert behavior depends on your Splunk edition and configuration.

How DeployOpen works on this

DeployOpen plans and implements the path from promptfoo red team results into your Splunk environment, inside infrastructure you control. The work is agreed in writing before it starts, so your SOC, security engineering and platform teams know what gets built, tested and handed over.

How we scope

  • The written scope names the promptfoo red team configuration, the export step and the Splunk destination it will feed.
  • We confirm which Splunk deployment you run, Splunk Cloud Platform or Splunk Enterprise, and who owns the HEC token and index.
  • Scope lists the failure fields, severity mapping and alert conditions the SOC is expected to receive from each run.

How we build

  • We build the export step that runs the latest eval to JSON and transforms failed results into HEC events.
  • We configure a dedicated HEC token and index with access limited to the events the SOC needs.
  • We test sample failing runs end to end so you can review the events and dashboards before live alerting is enabled.

How we hand over

  • You receive the export script, configuration notes and a record of the HEC token and index settings used.
  • Documentation covers how to rerun the export, what each event field means and how to tune alert thresholds.
  • We walk your SOC and platform owners through the dashboards and alerts so the handover is tested, not assumed.

How we support

  • Engagements are fixed-scope, and scope changes are agreed in writing before any extra work begins.
  • Ongoing support, upgrades and continuous testing of the export path are available as a retainer.
  • Before you rely on the pipeline for alerting, confirm your retention and access requirements with your own compliance team.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.