BotSting

DocumentationStart

Quickstart

See a full test on the practice system in about a minute, then scan a system of your own.

Install the command

BotSting needs Python 3.11 or later. Either of these puts the botsting command on your path:

uv tool install botsting      # with uv
pipx install botsting         # or with pipx

See it work

botsting demo

This serves a small support assistant on your machine twice, a vulnerable build and a fixed one, wired exactly as your own system would be, and attacks both. It writes a report and a sealed evidence bundle for each, and opens the first report in your browser. Nothing leaves your machine.

Scan your own agent

The scanner needs a few lines in a test copy of your agent, so that it can plant canaries and record tool calls. Install the library where the agent runs:

pip install botsting          # in the agent's own environment

Add the lines:

import botsting.harness as pp

# the web app: FastAPI, Starlette, Flask or Django. This line goes last.
app = pp.wrap(app)

# each tool that pays, sends or deletes: recorded, never run, during a test
@pp.action("issue_refund", never_for_users="a refund of 50 on order A-1001")
def issue_refund(order_id, amount): ...

# where a secret lives; call it while a message is handled
prompt = BASE_PROMPT + pp.planted("staff_code")

# optional: text someone else wrote, that the agent reads
note = pp.content("order_note", note)

Make a key, set it as BOTSTING_HARNESS_KEY where the agent runs and where you scan, and point the scanner at the agent's chat address:

botsting harness-key
botsting scan http://localhost:8000/chat

For a system on your own machine the scanner asks you to type your name to authorize the test. It then works out which field carries the message and where the reply is, checks that a failure could be seen, runs the attacks and opens the report.

Your real users notice nothing.The lines act only on requests that carry a test session signed with your key. Every other request reaches your code exactly as before.

What a first scan tests

  • Secrets in the instructions. Whether a user can talk the agent into revealing one.
  • Tools no user may cause. For each tool marked never_for_users, whether a conversation can make the agent call it.
  • Text the agent reads from elsewhere. At each place read with pp.content, whether planted text makes an ordinary request trigger a forbidden tool.

A scan runs every attack in the library that applies to your system. For a faster first look, --attacks built-in runs only the 21 built-in ones.

When something does not work

botsting doctor --target http:quick-localhost-8000

The doctor checks the setup step by step and prints the command or change that fixes the first step that did not pass. It sends nothing hostile.