BotSting

DocumentationTest a system

Testing the real system

A copy is never exactly the real thing: settings, data and connected services differ. The harness also works on a real deployment, at two levels.

Look only

Set BOTSTING_HARNESS_KEY on the real deployment. The real system, prompt and data are tested. In a test session every marked tool is recorded and not run, and real users are untouched. Canaries exist only inside each test conversation.

Record the authorization with --environment production, so that the report says what was tested.

Small real actions, under caps

For a tool you want proven end to end, write the limits in the system's own code:

@pp.action("issue_refund", live=pp.Cap(
    max={"amount": 10},                 # one call: at most 10
    only={"order_id": TEST_ORDERS},     # and only on these orders
    total={"amount": 50}, calls=5,      # one scan: at most 50 in all, 5 calls
))
def issue_refund(order_id: str, amount: float): ...

In a test, the tool runs for real only when all four of these agree. Otherwise it is recorded without running.

  1. The function carries a cap.
  2. The deployment lists the tool in BOTSTING_LIVE_ACTIONS.
  3. The target description lists it under live_actions, and the authorization names it with --live-tool.
  4. The call is inside every limit.

A call outside the limits is still evidence. If the system is talked into a refund of 500, the report shows the attempt and the cap that stopped it, and no money moves.

Check a test deployment is not wired to production

Before scanning a staging or preview deployment, check its settings for signs that it reaches live services:

botsting sterile-check --env-file staging.env

The check reports variable names and the rule that matched, never credential values.

What should stay in a copy

Attacks that change what other users see, such as shared memory, a knowledge base or public posts, should be tested in a copy and not on the real system.