> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cynative.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Interactive Sessions, Approvals, and Stopping Cynative

> Understand Cynative's interactive session model, the per-tool-call approval flow, how to stop a run gracefully, and how to use auto-approve for CI.

Cynative is designed to be used both interactively and non-interactively. In interactive mode, you review and approve every tool call before credentials are attached — giving you full visibility into what the model intends to do. In CI and scripted contexts, the same binary runs unattended with `--auto-approve`. This page explains how both modes work and how to control a running session.

## Session modes

Cynative offers three session modes that share the same underlying engine:

**Interactive session** — bare `cynative` with no arguments opens a full REPL with line editing and command history (arrow keys). Type tasks, see tool calls, approve or deny them, and follow up with new questions.

```bash theme={null}
cynative
```

**Seeded session** — pass a task as the first argument. Cynative runs the task, then stays interactive so you can follow up.

```bash theme={null}
cynative "live cloud resources absent from IaC - drift"
```

**Print mode** — the `-p` / `--print` flag runs a single task non-interactively and exits. Use this for scripts, CI pipelines, and pipes. The exit code carries the verdict.

```bash theme={null}
cynative -p "which IAM roles can escalate to admin?"
```

<Tip>
  Cynative prints a short operational footer (timing, token usage) to **stderr**, not stdout. So `cynative -p "..." > out.txt` captures the clean answer in the file while the footer appears in the terminal — no need to strip it manually.
</Tip>

## Approval flow

Before every tool call, Cynative presents the tool name and its full arguments for your review and waits for a single keystroke:

| Key | Effect |
| - | - |
| `y` | Run this call once. |
| `a` | Approve this tool for the rest of the session (scripts still print before running, but no further keystroke is needed). |
| Any other key | Deny this call. The agent receives a rejection and may stop or try a different approach. |

The approval prompt appears regardless of whether you started Cynative with a bare command, a seeded task, or `-p`. The only way to skip it is `--auto-approve` (see below).

<Note>
  Always provide the least-privileged credentials needed for your task. The action gate enforces a read-only policy before credentials are attached, but it is not a substitute for appropriately scoped credentials.
</Note>

## Stopping a task

While a task is running you can stop it gracefully at any time:

**Press Esc or Ctrl-C once** — Cynative sends a graceful-stop signal. The agent finishes any already-running tool call, then stops and prints `⏸ Stopped`. Pressing again with a task still running forces an immediate exit with code 130.

**Automatic halt** — when the agent hits repeated tool errors or repeated denials, it stops automatically, summarizes what it is blocked on, and asks for the missing information. You can provide it and continue, or end the session.

Both paths are safe: Cynative never leaves a dangling credential or an open API connection when it stops.

## Auto-approve

When there is no controlling terminal — in CI, cron jobs, Docker containers, or any non-interactive script — there is no one to press `y`. Use `--auto-approve` to skip the approval prompt:

```bash theme={null}
cynative -p --agent aws-privilege-escalation --auto-approve
```

`--auto-approve` composes freely with all other flags:

```bash theme={null}
# Full CI invocation
cynative -p --agent aws-network-exposure --auto-approve --config /etc/cynative/config.yaml

# Pipe a file in non-interactively
cat findings.json | cynative -p "triage these" --auto-approve
```

With `--auto-approve`, every tool call runs immediately without prompting. Code execution scripts are still shown on stdout before they run (use `-v` to also stream each inner call result to stderr), but no keystroke is required.

## Bash completion

Cynative ships completion scripts for Bash, Zsh, Fish, and PowerShell. Each subcommand's `--help` has full install instructions:

```bash theme={null}
cynative completion bash --help
cynative completion zsh --help
cynative completion fish --help
cynative completion powershell --help
```

Completion works on a fresh install before any configuration exists — it does not require a configured LLM or credentials.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.