Scanning Rasa chatbots with garak's Rasa REST generator

Test the dialogue system your users talk to by pointing garak's Rasa REST generator at your assistant's REST channel. This page covers the method, prerequisites, setup sequence and common failure points.

On this page

Scanning Rasa chatbots with garak's Rasa REST generator

A team running a Rasa assistant that customers talk to needs to know whether injection and jailbreak prompts can make it fail in ways the owner does not want. garak's RasaRestGenerator connects through the Rasa REST channel so that garak's probes run end to end against the assistant as users reach it, not against a bare language model behind it. garak describes its purpose as checking whether an LLM or dialog system can be made to fail in ways the owner does not want, and the Rasa generator is the part of garak that makes a Rasa assistant a valid target. The generator source is available in garak's Rasa generator source, and it is worth reading before the first run to confirm which request and response fields it sends and expects.

Before scanning, the team should confirm that the Rasa REST channel is enabled on the test deployment, that the endpoint URL and any authentication the channel requires are known, and that the scan runs against a non-production copy with the same policies, custom actions and model version as production. The scan will send adversarial messages through the same path customers use, so the owner should agree in writing which environment receives them, who can read the resulting logs, and whether custom actions that call back-end systems are stubbed. Rasa's own configuration, including its policies and fallback behavior, determines what the probes can reach, so the scope of the test should be recorded alongside the garak version used.

The output is a JSONL report of each attempt and its evaluation, plus a garak.log file that continues across runs, so results can be traced back to the exact prompts and replies. Treat a first scan as a baseline rather than a verdict: the team should review failed attempts with the assistant's designers, decide which failures are real exposure in your deployment, and rerun the same configuration after each change to the flows, policies or model. The team should confirm the exact generator name, configuration keys and supported Rasa version against the source and the garak user guide at docs.garak.ai before building a repeatable pipeline.

What you need before the first Rasa scan

Four items must be in place before garak can send a single probe to your assistant: a working garak install, a Rasa assistant with its REST channel enabled in a non-production environment, a network path from the scanning host, and written permission from the assistant's owner. Each one closes a different failure point, and confirming them first keeps the first run from stalling halfway through.

A garak install from PyPI

Install garak with pip into a dedicated virtual environment on a Linux or macOS host. The PyPI package requires Python 3.11 or newer, so check the interpreter version before installing, not after a failed run. Pin the garak version you plan to use, because scores and report fields can shift between releases. Record that version in the scan notes so later comparisons remain valid.

garak on PyPI

A Rasa assistant with REST enabled

The target must be a Rasa assistant whose REST channel is turned on in a test or staging environment, not the production bot your customers use. Confirm the Rasa version and the channel configuration with the team that owns the assistant, since the version determines which endpoints exist and how responses are shaped. Ask them which credentials, if any, the REST channel requires and which custom actions the assistant calls.

Network reachability from the scanner

The scanning host must reach the assistant's REST endpoint over the network path your environment allows. Test it with a plain HTTP request from that exact host before writing any configuration, because proxies, firewalls and ingress rules often differ between a laptop and a build server. Note the host and port the endpoint uses so the generator configuration matches the environment you have tested.

Written authorization from the owner

Get written permission from the assistant's owner before scanning, naming the environment, the scan window and the person who can stop the test. Injection and jailbreak probes send deliberately adversarial text, which can trigger custom actions, fill logs or create conversation records. Authorization protects both sides: the owner knows what to expect, and the scanning team has a documented scope if the assistant's behavior raises questions.

A storage location for scan output

Each garak run writes a JSONL report of every attempt and its evaluation, and a garak.log file that continues across runs. Choose a directory with enough free space and write access, and keep it separate from the assistant's data. Agree with the owner how long reports and logs are kept, since they contain the exact adversarial prompts and the assistant's replies.

How to configure the RasaRestGenerator step by step

This sequence takes a team from a bare garak installation to a first scan of a Rasa assistant, with a check at each step so failures are caught before a full probe run. The output is a JSONL report and a garak.log file that show every attempt garak made against the dialogue system.

  1. Install garak and confirm the Python version

    Install garak from PyPI with pip in a virtual environment on a Linux or macOS host, since those are the platforms garak is developed on. The PyPI package requires Python 3.11 or newer, so check the interpreter version before installing. Confirm the install by running garak's help command from the shell and seeing the command-line options print without errors. Pin the version you install so later reports can be compared against the same release, and record it alongside the scan.

  2. Confirm the Rasa REST channel answers a test message

    Before involving garak, send one plain message to the Rasa REST channel endpoint your users reach, using curl or a similar client from the host where garak will run. The request should target the same URL, sender and content type that the production widget uses. Check that the response is a JSON list containing the assistant's reply text. If the call fails, fix network access, the channel configuration or authentication first, because garak will report those failures as model weaknesses otherwise.

  3. Write the YAML file that describes the endpoint

    Create a YAML file that names the RasaRestGenerator and sets the endpoint URL, the request template and the fields that hold the message and the reply. Keep the request body identical to the test message from the previous step so only the probe text changes. Store the file in your scan directory under version control, and avoid placing credentials in it directly. Confirm the file is valid by starting garak with the config and a single trivial probe; a clean start with no connection or parsing errors shows the endpoint was read correctly.

  4. Run a small probe set with a low generation count

    Start with one probe family such as prompt injection or a single jailbreak probe, and reduce the number of generations per prompt below the default of five so the first run is quick and inexpensive to repeat. Pass the configuration file to garak and let the default probewise harness run each probe with its recommended detectors. Watch the console for the probe names and the attempt counter. The run has worked when garak finishes and prints a result line for each probe it executed.

  5. Read the JSONL report entries for each attempt

    Open the JSONL report that garak wrote for the run. Each line records one attempt, the prompt sent, the reply received from the Rasa assistant and the evaluation from the detector. Count the lines and compare them with the number of prompts times the generations you configured, so you know no attempt was dropped. Check a few replies by hand to confirm the detector judged the assistant's actual output rather than an error page or an empty string.

  6. Review garak.log for connection and parsing problems

    Open garak.log, which garak continues across runs, and search for errors, retries and warnings from the generator. Repeated timeouts or non-JSON responses usually mean the YAML request or response fields need adjusting, not that the assistant is weak. Clear each error source, then rerun the same small set. The sequence is complete when the log shows no generator errors for the run and the JSONL report entries match the replies you checked by hand.

How garak drives a dialogue system through its REST channel

A garak scan against a Rasa assistant is a loop of prompt, reply and score. garak's probes generate adversarial prompts, the Rasa generator (RasaRestGenerator) sends each one as a user message to the assistant's REST channel, and the assistant's reply returns to garak as the output under test. Detectors and evaluators then score that reply for the specific failure the probe was built to trigger, such as a jailbreak that succeeds, a system prompt that leaks or a forbidden action that the dialogue flow permits. Each attempt is one message in and one reply out, so the scan exercises the same path your users take through the channel, including whatever intent classification, policies and custom actions sit between the message and the response.

Because a single prompt can succeed only some of the time, garak makes 5 generations per prompt by default and marks a probe as FAIL when any attempt produces undesirable output. For a dialogue system this matters because Rasa responses can vary with conversation state and any randomness in the language components. Decide before the first run whether a single failed attempt is an acceptable finding for your use case, and record that choice alongside the scan configuration so later comparisons use the same rule. Confirm the generation count your garak version uses in its configuration documentation, since changing it changes what a FAIL means.

By default garak runs the probewise harness, which runs each probe with its recommended detectors. That default suits a first pass, but a Rasa assistant often needs checks that a general chatbot does not, such as whether the bot triggers a restricted custom action or reveals content from its domain files. Review which detectors apply to each probe family you select, and confirm that the REST endpoint returns the reply text in the field the generator reads. A misconfigured response field can produce empty outputs that score as passes, so check a sample of raw replies in the JSONL report before trusting the results.

How a garak probe reaches your Rasa assistant

The scan starts on the garak host, where the CLI loads probes and the RasaRestGenerator sends each prompt to the Rasa REST channel over the network. The Rasa server passes the message through its NLU and dialogue policies, and the reply travels back to the generator. Detectors then score each reply, and the results land in the JSONL report and garak.log on the scanning host. Check that the scanning host can reach only the intended REST endpoint, and that the report stays on the host you control.

Request path from the garak host through the Rasa REST channel and back to the report.

Mapping garak attempts to Rasa messages and sessions

This table maps each part of a garak attempt to the Rasa REST channel field it travels through and the output garak scores. Read it before the first scan to confirm where probe text lands, how sender identity is set, and which assistant replies the detectors evaluate. The main takeaway is that the sender identifier decides whether probes share one conversation history, which can change results.

ElementWhat garak sends or readsWhere to confirm
Probe promptEach probe attempt is sent as the user text of one messageMessage text field in the generator source and the request body your Rasa channel accepts
Message bodyA JSON request with the sender and message fields that the REST generator builds from its YAML endpoint fileBody template in the garak Rasa generator and the REST channel settings in credentials.yml
Sender identifierThe value that tells Rasa which conversation to continue; it sets the tracker used for session memoryWhether the generator reuses one sender value or varies it per attempt, and how your deployment stores trackers
Session stateEarlier probes may leave slots, forms or context that influence later replies if the sender value is reusedTracker store settings and whether sessions reset between attempts in your test configuration
Assistant text responseThe plaintext reply, or the text field of the JSON reply, passed to detectors as the output to evaluateResponse key path in the endpoint file and the shape your Rasa channel returns for multi-message replies
Multiple replies per turnOne user message can return several assistant messages, which may need to be joined before evaluationBehavior of your custom actions and response templates; test a single turn manually first
Custom actions and fallbacksServer-side actions can change or hide text garak sees, so the evaluated output may differ from the scripted replyAction server logs and the fallback responses in your domain file

Securing the scan and the assistant under test

A garak run against a Rasa assistant sends adversarial prompts into a live dialogue system and records every reply. The cards below cover the controls that keep that test contained: who authorizes it, which assistant it reaches, how credentials and network paths are handled, and how the resulting logs are stored.

Get written authorization first

Before any probe runs, get signed approval from the owner of the assistant, the channel and the hosting environment. The approval should name the Rasa deployment, the REST channel endpoint, the test window and the people who may view results. Probes such as jailbreak and injection attempts can trigger fallback flows, handoffs or downstream actions, so the owner needs to know the test is coming and agree on who responds if something unexpected happens.

Scan a test or staging assistant

Point garak at a staging or test assistant with a copy of the model and dialogue configuration that matches production, not at the live bot your customers use. Exclude production customer data from the test environment, including conversation history, user profiles and any custom actions that read or write real records. If a production-like dataset is required, ask for synthetic or masked data and confirm that the custom action server behind the assistant is also a test instance.

Handle endpoint credentials carefully

Confirm with the client how the REST channel authenticates in their environment, including whether it uses a shared token, a per-client credential or no authentication on an internal network. Store the value in an environment variable or secrets manager, not in a YAML file committed to source control, and use a credential with the narrowest access the channel allows. Rotate it after the engagement and confirm that the test identity cannot reach administrative endpoints.

Restrict the scanning host network path

Run garak from a host that can reach only the staging REST endpoint, using allow-listed egress rules, and confirm the route before the first attempt. Keep the scanner off the production network segment and avoid routing its traffic through shared proxies that other teams monitor. Record the source address so the assistant owner can match scan traffic to the test window in their own logs.

Protect garak.log and JSONL reports

Each garak run writes a JSONL report of every attempt and its evaluation, and a garak.log file that is continued across runs. Both can contain sensitive prompts, assistant replies and fragments of test data, so store them in an access-controlled location with encryption at rest, limit read access to the test team, and set a retention period agreed with the owner. Review the log for accidental secrets before sharing the report outside the team.

Read the source

Reading results and retesting after fixes

A FAIL from garak means at least one attempt on a probe produced output that its detector flagged as undesirable, and the report gives a failure rate for that probe. Read the failure rate per probe, not the overall verdict. For a Rasa assistant, the probes that matter most are the prompt injection and jailbreak families, because they test whether a user message can pull the bot off its intended flows, reveal fallback or system wording, or get it to call a custom action it should refuse. Open the JSONL report for each failing probe and read the prompt, the response from your REST endpoint and the detector result side by side. Check whether the response was actually harmful for your business, or whether the detector flagged a benign refusal or an off-topic answer. Confirm with your installed garak version which fields the report and digest contain, since the layout has changed across releases.

Treat one run as a sample, not a measurement. garak makes several generations per prompt by default, and a probe's result depends on the model, the conversation state and the Rasa policies, which can produce different responses on different runs. A low failure rate on one run does not show the assistant is safe, and a single FAIL may not reproduce. Record the garak version, the Rasa model version, the generator configuration and the run date with each report so differences between runs can be traced to a change rather than to noise. Where a result drives a release decision, repeat the run and look for consistent failures across runs before deciding.

After you change flows, fallback rules or custom actions, rerun the same probe selection against the same REST endpoint configuration so the comparison is fair. Keep the earlier report, change one thing at a time where you can, and check that failing probes now pass and that previously passing probes still pass. Changes to fallback rules often shift jailbreak results in both directions, so a fix in one flow can open a gap in another. Store the before and after reports together and note which change each fix addressed. Confirm with the garak user guide how comparison between runs is handled in your installed version before you rely on a comparison in a sign-off.

Common failures when garak scans a Rasa REST endpoint

This table lists the failures teams most often hit when pointing garak's Rasa REST generator at an assistant, with the likely cause and a configuration check to run. Work through the rows in order, since connectivity and response format problems hide the later ones. Each fix is something you can verify in your own endpoint configuration and logs before rerunning the scan.

FailureLikely causeFix to check
Connection refused or timeoutsThe scanning host cannot reach the Rasa server port, or the endpoint URL in the generator config points at the wrong host, port or pathConfirm the REST channel URL from the scanning host with a single manual request, then match host, port and path exactly in the generator YAML
Responses not readable as plaintext or JSONThe Rasa channel returns a payload shape the generator does not parse, or a custom action wraps replies in an unexpected structureCapture one raw response, check it is plaintext or JSON, and set the response field path in the config to match the reply text
Channel authentication rejects requestsThe REST channel requires a token or credentials that the generator config does not send, or the token has expiredCheck the channel credentials in your Rasa configuration, supply the same token through the environment variable or config key the generator reads, and test with one request
Sessions carry state between attemptsEach probe prompt reuses a sender ID, so earlier turns change how the assistant answers later attempts and skews resultsConfirm the sender ID handling in the generator config, use a fresh sender per attempt if supported, and compare a repeated prompt against a clean session
Runs exceed rate limitsParallel attempts and five generations per prompt send more requests than the gateway or assistant tolerates, causing errors that look like failed probesCheck gateway and server rate limit settings, reduce parallelism in the run configuration, and review the garak.log for repeated error codes before trusting the FAIL results
Errors logged as probe failuresTransport or 4xx/5xx errors are recorded as attempts, so a failure rate reflects outages rather than assistant behaviorSearch the JSONL report and garak.log for non-200 responses, rerun affected probes after fixing connectivity, and discard attempts that never reached the model logic

Questions teams ask before scanning a Rasa assistant

Is garak free to use for scanning a Rasa assistant?

Yes. garak is licensed under Apache 2.0, and its maintainers describe it as a free tool. The license governs the software itself, so your organization still pays for the infrastructure the scan runs on, the time of the people who configure and read it, and any outside help you choose to buy. Confirm the license terms against the repository before you adopt it, and have your legal team review them against your own policies. The garak README is the place to start.

What does a first garak scan of a Rasa assistant involve?

A first scan covers four pieces: a REST generator configuration that describes your Rasa endpoint, a check that the assistant answers test messages correctly, a probe selection, and a review of the JSONL report. The effort depends mostly on how the assistant is built. A simple assistant behind an open REST channel is a small job. Custom actions, authentication, session handling and multiple channels add work. Ask for a written list of the endpoints and flows in scope before estimating effort.

What drives the cost of scanning a Rasa assistant?

Three things drive cost: scope, endpoint complexity and remediation support. Scope covers how many channels, intents, custom actions and environments you want tested. Endpoint complexity covers authentication, session state, response formats and any guardrail or backend services the assistant calls. Remediation support covers whether you want help fixing what the scan finds and retesting afterward, or only a findings report. Each of these is a separate line item in a quote, so ask for them to be priced separately.

What must our team provide before a scan starts?

Your team provides the access and context that a scan cannot infer. Expect to supply a test or staging Rasa deployment with its REST channel enabled, a test account or session credential if the channel requires one, the list of custom actions and external systems the assistant calls, and a named contact who can approve probe traffic against the endpoint. You should also confirm that the host running garak is allowed to reach the assistant, and that the scan will not write to production customer data. Agree these items in writing with the scope.

Can one of our engineers run a garak scan on a Rasa assistant alone?

An engineer who knows Python, the command line and the Rasa REST channel can run a basic scan alone, because garak is installed from PyPI with pip and the Rasa generator is configured through a short YAML file. The harder parts are interpreting results, deciding which probe families matter for your assistant, and fixing dialogue flows or custom actions. garak requires Python 3.11 or newer. Confirm that your engineer has time for the review work, not only the setup, before deciding to do it in house.

How long does a Rasa assistant scan take?

No duration is supplied for this work, and the scope determines it. The main variables are how many endpoints and flows you test, how long each probe run takes against your assistant, how many generations you configure per prompt, and whether you need time for fixes and a retest. Your team should ask any provider for a timeline tied to a written scope, with separate milestones for setup, the scan run, the findings review and any retest.

Does a garak scan prove that our Rasa assistant is secure?

No. garak checks whether an LLM or dialog system can be made to fail in ways the owner does not want, using the probes and detectors it includes. A scan shows which attempts produced undesirable output during the test window. It does not cover every injection or jailbreak technique, and it does not replace a broader security test of your deployment. Treat the report as evidence about the tested configuration on the day it ran.

How DeployOpen works on this

DeployOpen scopes a Rasa garak engagement against your assistant's REST channel, your deployment and the attack classes that matter for your dialogue flows. We build and run the scan in your environment, then hand over the reports, the configuration and the fixes with a retest.

How we scope

  • Confirm which Rasa assistant, REST channel and endpoint version the written scope covers.
  • Agree which garak probe families, such as prompt injection and jailbreaks, run against the dialogue system.
  • Record the data, test accounts and network access the scan needs, and who approves each.

How we build

  • Write and test the garak REST configuration file that describes your Rasa endpoint and its response format.
  • Run a pilot scan on a non-production assistant to check responses, timeouts and parsing before full runs.
  • Tune probe selection, generation counts and detectors so results match the agreed scope and are repeatable.

How we hand over

  • Deliver the JSONL reports, garak.log output and a written summary of failing probes and dialogue paths.
  • Provide the garak configuration files and run instructions so your team can repeat the scan.
  • Document recommended fixes and retest the affected flows after your changes are applied.

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • Ongoing rescans and continuous testing are available as a retainer after the first scan.
  • Ask for a written quote that follows from the agreed scope, since DeployOpen does not publish a price list.

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.