# Authorize agent tools and workflow

Source: https://usecns.dev/cortex-topic-authorize-agent-tools-and-workflow/

[Start here](https://usecns.dev/manual-cortex/)
[CLI commands](https://usecns.dev/commands-cortex/)
[Configuration & integration](https://usecns.dev/cortex-topics/)

The durable agent's six base tools are distinct from CLI/MCP operator tools. They are granted by seat creation and may cause file/process effects:

| Agent tool | Arguments and observable behavior |
| --- | --- |
| `read_file` | `path`, optional `start_line` (1), `max_lines` (400) → text slice; records read path. |
| `write_file` | `path`, `content` → JSON text `{ok:true,path}`; creates directories, overwrites file, records edit, invokes memory/policy gates. |
| `edit_file` | `path`, `old_text`, `new_text` → replaces first exact match; missing text errors. Records edit/memory hooks. |
| `bash` | `command` → stdout on success, combined output and `isError:true` otherwise; bounded at 120 seconds and last 20000 output characters. Runs in seat cwd with configured shell. Test-like commands update workflow check records. This is not a security sandbox for arbitrary shell commands. |
| `classify_state` | `state` (any JSON), optional `questions`, `instructions`, `criteria` → answers plus `_meta` backend/elapsed time. Uses conversation System 1 configuration. |
| `codemode` | `code` → bounded QuickJS composition of declared tools and `models.getModelOfType` / `models.classify`; no ambient Node/filesystem/network globals. 120-second, 256 MiB bounds. Calls can still mutate through granted tools; workflow store/invocation records are durable. |

Workflow policy names are `none`, `orchestrator`, `implementer`, or catalog aliases. The implementer policy tracks reconnaissance, edits, tests/checks and closeout, and can steer insufficient progress/verification. Seat `workflowPolicyOptions` configures `literalGate` suites, `publicSuite`, `requireUnitAndFeatureTests`, feature/unit test prefixes. A configured missing gate must not be silently substituted. The test-creation gate is a tool-path policy, not a claim that every filesystem/shell write is prevented. Forking restores rewindable workflow documents but cannot rewind shell or external actions.

Optional Engram adds six agent tools: `engram_recall` (`key_or_query`); `engram_record` (`body`, optional kind/key/ring/ring\_id, source\_authority, compact\_summary, supersedes/contradicts/refines keys, scope\_globs, anchor\_paths); `engram_complete` (`memory_id`, `one_line_summary`, optional `compiled_guard`); `engram_outcome` (`signal`, optional memory\_id/event\_id); `engram_distill` (`source_memory_ids`, `body`, optional kind/key/ring/compact\_summary/scope\_globs); `engram_status` (no args). They return Engram CLI output as text and flag nonzero exits as tool errors. Recording/completing/distilling/outcomes mutate memory; consult the [Engram reference](https://usecns.dev/commands-engram/) for authority, guard and graduation semantics. Caller-supplied custom tools and outbound MCP mounts add deployment-specific schemas: inspect the configured seat instead of assuming a fixed global inventory.