Skip to main content

doctor

Validate your configuration and test connectivity to the Know Your AI backend.
Checks performed: Each check shows (pass) or (fail). If checks 1 or 2 fail, remaining checks are skipped.

target

Display the full configuration of your linked product.
Output sections:
  • Product — Name, ID, workspace, type, environment, active status, description
  • Target Configuration — URL, CSS selectors (input, submit, response, waitFor), max tokens, rate limit
  • API Connection — Status, API type, endpoint, model, message/response fields, connected at/by
  • Metadata — Default judgment model, owners
  • Timestamps — Created and updated dates

list / ls

List all evaluations and datasets for the linked product.
Output: Two formatted tables: Evaluations: Datasets:

evaluate / eval

Run an evaluation and monitor progress in real time.
Arguments: Flags: Example:
During execution, a live progress bar is displayed:
On completion:
Outcome messages:
  • All tests pass: ✔ All 50 tests passed! Your AI system is secure against these prompts.
  • Some vulnerable: ⚠ 2 out of 50 tests found vulnerabilities.

describe

Show comprehensive details about an evaluation.
Arguments: Output sections:
  • Evaluation — Name, ID, product, description, category, type, tags
  • Judgment Configuration — Judge model, threshold, judge prompt (truncated)
  • Schedule — Cron expression, last/next run times (if configured)
  • Advanced Settings — Timeout, concurrency, retry config, notifications (if configured)
  • Linked Datasets — List of datasets with names
  • Recent Runs — Last 5 runs with status, score, ID, and relative date
  • Stats — Total run count, created/updated timestamps, created by
Quick action hint: Prints the evaluate command at the end:

history

Show recent evaluation run history across all evaluations.
Flags: Example:
Output: A table sorted by most recent first: Status icons: Score coloring:
  • ≥ 80%: green
  • ≥ 50%: yellow
  • < 50%: red

result

Show detailed results for a specific evaluation run.
Arguments: Output sections:
  • Run Overview — Run ID, evaluation name, status, run type, target model, judge model
  • Results — Total tests, completed, secure (green), vulnerable (red), score with visual bar:
  • Selected Attacks — Attack IDs (if present)
  • Compliance Results — JSON data (if present)
  • Behavior Analysis — JSON data (if present)
  • Timing — Started, ended, duration (auto-formatted), created
  • Dashboard link — Full URL to the run in the web dashboard
  • Failure reason — Shown if the run failed

help

Displays all available commands, their syntax, environment variables, and usage examples.

version

Prints the CLI version: @know-your-ai/cli v0.1.7

Error handling

All commands follow the same error handling pattern:
  1. Missing DSN — Prints guidance on setting KNOW_YOUR_AI_DSN and exits with code 1
  2. Invalid DSN — Prints format error and exits with code 1
  3. Auth errors — Shows “unauthorized” or “forbidden” with specific messaging
  4. Network errors — Shows the raw error message
  5. Non-critical failures (e.g., resolving product name) — Falls back to IDs silently

Environment variables

DSN format: