Skip to content

context

The context commands run semantic searches against the Ingrain Context Platform, your organization’s ingested documents and recorded security rules. Each query is matched on meaning, not keywords. There are two subcommands, one per source of context:

  • documents — your organization’s ingested security documents.
  • security_rules — prior security rules your security team has recorded.
Terminal window
ingrain context documents <query> [--limit N] [--json]
ingrain context security_rules <query> [--limit N] [--json]

Semantic search across ingested security documents.

Terminal window
ingrain context documents "data retention policy for customer PII"

Semantic search across recorded security rules.

Terminal window
ingrain context security_rules "why did we choose mTLS between services"

Both subcommands accept the same flags:

FlagDescription
--limit <N>Maximum results to return, 150. Defaults to 5 for documents, 10 for security rules.
--jsonEmit raw JSON results to stdout, in place of the human-readable list.

If nothing matches your query, the command prints a short hint — including whether your organization has any documents or security rules ingested yet.

context talks to the Ingrain Context Platform over a sync URL and an API token. Provide them via either:

  • the INGRAIN_SYNC_URL and INGRAIN_API_TOKEN environment variables, or
  • a [context] section in your user-level conf.toml with syncUrl and ingrainApiToken fields.

Run config to find your conf.toml. Set both values before running a search. See the [context] configuration page for the full key reference and validation rules.