# keryn runtime check

Describes Keryn 0.5.2 and keryn-rules 0.8.0.

> keryn runtime check: Keryn Runtime (IAST, RASP, request inspection): install the agent into an application, verify it, report its events

Source: https://keryn.dev/docs/reference/cli/runtime-check/

> **Caution: Next release: keryn runtime check**
> On main; not in Keryn 0.5.2, the latest release.

Keryn Runtime (IAST, RASP, request inspection): install the agent into an application, verify it, report its events.

```text
keryn runtime check [dir] [--app <id>] [--json]
```

## Options

```text
Usage: keryn runtime init [dir] [--app <id>] [--dry-run] [--json]
       keryn runtime check [dir] [--app <id>] [--json]
       keryn runtime report <events.jsonl | log export> <out-dir> [--declared <ops.json>] [--json]
  Keryn Runtime is an agent that runs inside your application: IAST reports where request input reaches a sensitive
  operation, RASP refuses a dangerous operation as the code is about to perform it, and Edge inspects each request in
  front of the handler. It covers Deno and Supabase Edge Functions, Cloudflare Workers, Vercel, Netlify and Node.
  init    finds what the application in <dir> (default: the current directory) runs on, copies a pinned copy of the agent
          next to the code and wires it in: completely for Supabase Edge Functions, Cloudflare Workers and Node; for Vercel and
          Netlify handlers it prints the lines to add. --dry-run shows the plan and writes nothing. Safe to run again.
          Nothing it adds changes behaviour until a KERYN_RUNTIME_* variable is set in the application's environment.
  check   exits 1 when a pinned copy was edited or an entry point lost its wiring. For CI.
  report  reads the agent's events (KERYN_RUNTIME_REPORT=file:<path>, or a platform log export with "keryn.rt" lines) and
          writes summary.md, findings.json and analysis.json to <out-dir>. --declared lists the operations each function
          is meant to serve, so that undeclared ones are reported.
  The agent ships inside this CLI and is verified against its sha256 manifest before it is copied. Nothing is downloaded
  and nothing is sent. KERYN_RUNTIME_PACK=<dir> reads another unpacked agent release.
  Exit 0 done; 1 no supported entry point found, or a failed check; 2 bad usage or an unreadable pack or events file.
```

## Examples

```sh
# In CI: fail when the pinned copy was edited or an entry point lost its wiring.
keryn runtime check
```

## Exit codes

| Code | Meaning |
|---|---|
| 0 | the copies match their manifests and the entry points are wired |
| 1 | a copy was edited, is missing, or an entry point is not wired |
| 2 | not a directory or bad usage |

## Environment

| Variable | Meaning | Default |
|---|---|---|
| `KERYN_RUNTIME_PACK` | Directory of another unpacked Keryn Runtime release, used by keryn runtime in place of the agent inside this CLI. | the agent inside this CLI |
