Readyset Docs

Data Agents

Use RDST's guard and agent commands to give other systems scoped access to a database.

rdst agent and rdst guard are a pair of commands for exposing scoped, read-only access to a database target, typically to a Slack bot, an HTTP client, or an AI assistant, without handing out raw database credentials.

Use agents and guards when another user or service needs access through a restricted interface. Configure the tables, query rules, and output masking that interface requires.

Guards

A guard is a reusable safety policy. Guards combine output masking, query-shape requirements, cost limits, and runtime bounds:

rdst guard create --name pii-safe \
    --mask "*.email:email" \
    --require-where \
    --require-limit \
    --no-select-star \
    --max-rows 10000

rdst guard list
rdst guard show pii-safe
rdst guard check "SELECT * FROM users" --guard pii-safe

rdst guard check is a dry-run. It takes SQL and tells you whether the guard would allow or reject it. Useful in CI to ensure the queries your application generates will be accepted.

See rdst guard --help for the full flag set (masking types, required filters, cost thresholds, natural-language --intent, and more).

Agents

An agent binds a database target to a guard:

rdst agent create --name sales-bot \
    --target prod-orders \
    --guard pii-safe

rdst agent list
rdst agent chat --name sales-bot       # interactive terminal session
rdst agent serve --name sales-bot      # HTTP API
rdst agent slack --name sales-bot      # Slack bot (requires rdst slack setup first)

rdst agent serve listens on 127.0.0.1:8080:

curl -d '{"question": "How many orders shipped last week?"}' http://127.0.0.1:8080/ask

To require a bearer token on /ask and /schema, set RDST_AGENT_TOKEN (or pass --token) and send it as Authorization: Bearer <token>.

Web pages on other sites can't call the server. To let a browser app call it, pass its origin with --allow-origin https://app.example.com (repeatable); that origin also receives CORS headers.

Every agent interaction runs through the guard before SQL is generated and again before execution, so output masking and cost limits apply consistently across all serving modes.

Agent serving modes, Slack app setup, and advanced guard policies are subject to change. Run rdst agent --help and rdst guard --help for the current flag surface before building anything on top.

See also

  • rdst ask: interactive natural-language SQL for the case where you don't need a guarded interface
  • Slack integration: Slack app setup, separate from attaching an agent to it