Skip to navigation

Testing internal agents

Check Point AI Red Teaming connects to an agent in one of two ways. The right one depends on whether Red can reach your agent from the internet.

Left: AI Red Teaming sends attacks inbound to your agent's public HTTPS URL, optionally through a firewall that allows Red's IP ranges. Right: the SDK runner inside your private network connects outbound to AI Red Teaming, pulls attacks, passes them to your private agent with a local call, and returns the replies. Red never opens a connection into the private network.
Who opens the connection. An Agent target needs inbound access; the SDK runner needs only outbound HTTPS.
Agent target (platform)SDK runner
Who starts the connectionRed calls your endpointYour runner calls Red
Inbound access to your networkRequired: Red must reach the endpoint from the internetNone
Outbound access from your networkNoneHTTPS on port 443 to your region’s Red API host
Where the agent’s credentials liveStored on the target in RedIn your handler, inside your network
How a scan startsFrom the Red consoleFrom the runner, for example a CI/CD job
SetupFill in a formInstall a package and write a short handler

If your agent is public, or you can expose it through an ingress or proxy, use an Agent target and see Network connectivity. If the agent is internal and inbound connections to your network aren’t allowed, use the SDK runner described on this page.

“SDK” covers two separate things. The SDK runner carries Red’s attacks to your agent and returns the agent’s replies. It runs next to your agent and doesn’t change it. Tool tracing is optional: it adds a call inside your agent’s code, and your agent then reports its tool calls to Red. You don’t need tool tracing to test an internal agent. If you turn it on, the agent’s runtime also needs outbound HTTPS to the same Red API host.

How the runner works

The runner is a short script you write with the lakera-red-sdk package (TypeScript or Python). It works like this:

  1. You run it inside your network, on any host that can reach the agents under test. One host can test many agents.
  2. It opens an outbound HTTPS connection to the Red API for your region: red-webhooks.lakera.ai in the US or red-webhooks-eu.lakera.ai in the EU. It pulls each attack prompt, passes the prompt to your agent with a local call, and returns the agent’s reply on the same connection.
  3. The runner doesn’t listen on any port, and Check Point never opens a connection into your network.

Red generates the attacks, judges the replies, and stores the results. The runner only relays: it passes each prompt to your agent and sends the reply back to Red.

How authentication works

The runner uses two separate credentials:

  1. Runner to Red. The runner authenticates with a Red Team API Key, which the quickstart reads from the LAKERA_RED_API_KEY environment variable. Each key is scoped to one folder and only reaches the targets, scans, and results in that folder. See Red Team API Keys.
  2. Runner to your agent. Your handler calls the agent, so it holds the agent’s address and credentials, for example a bearer token from your secrets manager. The SDK never sends them to Check Point.

Data shared with Red lists everything the runner sends.

What you write: the handler

The handler is the only code specific to your agent. It receives each attack prompt, calls your agent, and returns the reply:

const handler = async (session) => {
for await (const { attack, respond } of session) {
const res = await fetch("https://support-agent.internal.example/chat", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AGENT_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ message: attack }),
})
if (!res.ok) throw new Error(`Agent returned ${res.status}`)
const { reply } = await res.json()
await respond(reply)
}
}

Replace the URL, auth header, and request and response fields with your agent’s own. The rest of the script (create the client, create or reuse a target, create a scan, and call scan.run(handler)) is the same for every agent. See the SDK Quickstart for the full script.

Requirements

  1. A host inside your network that can reach the agent, such as a VM, a container, or a CI/CD runner, with Node.js 22+ or Python 3.11+. See Deployment for runtime details.
  2. Outbound HTTPS on port 443 to your region’s Red API host. See Network connectivity for the hostnames. Corporate proxies and TLS interception are supported. See Running behind a corporate proxy.
  3. A Red Team API Key for the folder that holds the target and its scans.

You don’t need inbound firewall rules, a public endpoint, or an allowlist of Red’s IP addresses.

Where results appear

The Red console shows the runner’s targets, scan progress, and scan reports like any other scan. Each scan also returns a direct link to its report in scan.dashboardLink (TypeScript) or scan.dashboard_link (Python). To keep a local copy, the runner can write the results to a JSON file.

Upgrades

You pin the lakera-red-sdk version in your project and choose when to upgrade. The Changelog lists each release, and the docs for earlier versions stay available under SDK › Previous versions.

Current limitations

  1. Scans start from the runner, not the console. To scan on a schedule, run the runner as a scheduled job, for example in your CI/CD pipeline. See Run Scans in CI/CD. Starting or scheduling runner scans from the console isn’t available.
  2. No packaged image. The runner isn’t available as a prebuilt container image or Helm chart. You install the package and write the handler. To run it in a container, use any Node.js 22+ or Python 3.11+ base image.

Next steps

  1. SDK Quickstart to run a first scan.
  2. Deployment for network, proxy, and runtime details.
  3. Run Scans in CI/CD to scan on every release or on a schedule.