Skip to main content
These two commands let you inspect a clone’s database — the primary way to score what an agent actually did.

query

asymmetric query <id> [sql] [options]
Runs SQL against the clone’s database. Read-only by default — reads are enforced at the connection level (default_transaction_read_only=on), so a stray UPDATE can’t slip through unless you ask for it.

Arguments

ArgumentRequiredDescription
<id>yesThe clone id.
[sql]noInline SQL. Omit to read from --file or stdin.

Options

OptionDescription
--jsonOutput rows as a JSON array. SELECT only — can’t combine with --write.
-w, --writeAllow writes. Off by default.
-f, --file <path>Read SQL from a file.
SQL source precedence: --file > inline argument > stdin.

Examples

Inline read:
asymmetric query slack-a1b2 "select count(*) from messages"
 count
-------
    20
(1 row)
JSON for programmatic scoring:
asymmetric query slack-a1b2 "select id, name from channels" --json
[
  { "id": 1, "name": "general" },
  { "id": 2, "name": "random" }
]
From a file or stdin:
asymmetric query slack-a1b2 -f ./check.sql
echo "select now()" | asymmetric query slack-a1b2
Deliberate write (off the default safety rail):
asymmetric query slack-a1b2 "delete from messages where id = 5" --write

Guardrails

InvocationResult
--json --writeExit 2: “—json is for reads; drop —write or drop —json.”
No SQL anywhereExit 2: “No SQL given. Pass it inline, with -f <file>, or via stdin.”

Errors you might see

ErrorCause
CLONE_NOT_FOUNDNo clone with that id.
CLONE_START_FAILEDShared Postgres is down — spin a clone first — or the SQL itself failed.

db

asymmetric db <id> [options]
Prints the exact docker compose exec + psql command to open an interactive shell into a clone’s database (clones share one Postgres container, so the command targets the shared postgres service and selects the clone’s database with -d). It doesn’t open the shell or touch Docker — it just gives you the command to run, so you can copy it or pipe it.

Options

OptionDescription
--jsonOutput the connection facts as JSON.

Examples

asymmetric db slack-a1b2
  clone slack-a1b2 · db clone_slack_a1b2
  open a shell with:

  docker compose -p asym-shared -f compose.shared.yml exec postgres psql -U postgres -d clone_slack_a1b2
JSON:
asymmetric db slack-a1b2 --json
{
  "id": "slack-a1b2",
  "database": "clone_slack_a1b2",
  "command": "docker compose -p asym-shared -f compose.shared.yml exec postgres psql -U postgres -d clone_slack_a1b2"
}
Open the shell in one line:
eval "$(asymmetric db slack-a1b2 --json | jq -r .command)"

Errors you might see

ErrorCause
CLONE_NOT_FOUNDNo clone with that id.