Quickstart
The Check Point AI Red Teaming SDK (lakera-red-sdk) lets you run adversarial scans
programmatically. Use it to integrate red teaming into CI/CD pipelines, test custom
agent flows, or automate security assessments without the web UI.
The SDK is outbound-only: your process pulls attack prompts from the Red API over HTTPS, so you don’t need to expose any inbound endpoints or open inbound firewall rules. See SDK Deployment for network requirements, proxy configuration, and runtime details.
Prerequisites
TypeScript
Python
- Node.js 22+
- A Check Point account with Red access enabled
- An API key from the AI Red Teaming platform
Install
TypeScript
Python
Try a Runnable Example
The SDK includes ready-to-run examples to help you get started quickly.
TypeScript
Python
See the examples helper reference for the full list of examples and commands.
Run Your First Scan
Create a target
A target represents the agent you’re testing. Its name is reused across scans — if a target with that name already exists, the SDK uses it. Each target owns a recon profile: a structured description of your application that helps Red tailor its attacks. You set it up once, at target creation, and it’s reused by every scan.
You have two ways to provide the profile:
- Pass
appContext(orappContextFile) to set it directly — no recon runs. - Omit the context and pass a handler. The SDK then runs a short reconnaissance phase by relaying prompts through your agent, and saves the result on the target.
A profile you pass with appContext (or appContextFile) always wins — it overwrites
whatever the target already held. Only when you omit the context does an existing
profile (from a previous run or the dashboard) get reused, in which case neither of the
above runs.
TypeScript
Python
Alternatively, load the context from a YAML file:
Or omit the context and let recon run through your agent. Pass a handler (the same
signature you’ll use for scan.run() below):
Add ground truth (optional)
Beyond the recon profile, you can give Red the target’s ground truth — its actual system prompt and/or tool definitions. The judge uses this to evaluate attacks more precisely (for example, to confirm a leaked system prompt or an out-of-policy tool call rather than guessing), which reduces false positives. Like the recon profile, ground truth lives on the target and is reused across scans.
Provide it inline via groundTruth, or through the same YAML file as your app context
using its systemPrompt / tools keys. Both fields are optional — supply whichever
you have.
TypeScript
Python
See Ground Truth for the full field reference and the YAML file layout.
Create a scan
Define what you want to test. Pass the targetId from the target returned by
createOrGetTarget — the recon profile is read from the target.
TypeScript
Python
You can also define custom objectives alongside standard ones:
See CustomObjective for the full field reference.
Handle attack sessions
The scan.run() method drives the scan. For each concurrent session, your handler
receives adversarial prompts and submits your agent’s responses.
You can also follow the scan’s progress in the dashboard via
scan.dashboardLink / scan.dashboard_link.
TypeScript
Python
Each session may contain multiple turns (especially with the crescendo strategy).
The async iterator handles this naturally — just keep looping. The finally block
ensures your agent is properly shut down once the session completes or errors out.
Full Example
TypeScript
Python
Next Steps
- See the SDK Reference for all configuration options and types
- Learn about attack categories Red tests for
- Set up AI Guardrails Integration to remediate findings automatically