safedep query command runs SQL-like queries against SafeDep Cloud’s analytics surface.
This surface holds the packages, projects, endpoints, events, and security findings collected across
your tenant, enriched with global threat intelligence (vulnerabilities, EPSS,
CISA KEV, OpenSSF Scorecard, and more).
Prerequisites
Install thesafedep CLI and sign in. For the steps and a first query, see Query Your Tenant with SQL.
SafeDep scopes every query to your tenant. You never write a tenant filter
yourself.
How the data is organized
Tables come in two kinds:- Tenant tables hold your data. They are
projects,project_versions,boms,packages,endpoints, thecomponent_*finding tables, and the event tables (inventory_events,package_guard_events,package_guard_sandbox_violations). - Join-only enrichment tables hold global reference data shared across all
tenants. They are
vulnerabilities,epss,kev,licenses,malware_analysis,open_source_packages,open_source_projects,scorecards,scorecard_checks,terraform_providers.
What SQL we support
Every query must filter on an indexed column or a bounded time range. The schema marks which columns are indexed.
The query language does not support these features:
- Subqueries
- CTEs (
WITH) UNIONand set operations- Window functions
- Casts
- Arbitrary functions
- Multiple statements
Discovering the schema
You do not need to memorize tables or columns. The schema is self-describing, and this is the entry point for both humans and AI agents.schema get also prints the join edges (which tables connect, and their
cardinality) and the usage rules with example queries, so one call gives you
everything needed to write a valid query.
Output modes
Select with-o / --output. When omitted, the CLI auto-detects the format. It
renders a table for an interactive terminal and plain text when piped.
JSON shape:
next_page_token only when a next page exists. The last page has no token.
Pagination
Pagination is caller-driven. The CLI does not auto-iterate. Fetch the first page, then re-run the same query with the returned token:TOK is empty, the first page was the last page.
Troubleshooting
SafeDep Cloud Overview
See what SafeDep Cloud collects to build the data you query.
Authentication
Sign in with
safedep auth login before running queries.Vet Filtering
Filter findings locally with Vet’s CEL query language.
API & Automation
Get programmatic access to SafeDep’s APIs.

