Skip to content

Add Edict to your agent harness

Your harness writes the code. Edict changes the cloud. Your coding agent keeps doing what it does well, and when it needs to change your cloud it asks Edict instead of running aws, terraform or kubectl itself.

This matters because of where the credential lives. If a cloud credential sits in the agent’s environment, deny rules and allowlists only make it harder to use. They do not make it safe. With Edict, the agent holds no cloud credential at all. It sends a request, Edict checks it against your policy, the right person approves it where your rules require it, and Edict runs it in your AWS account with a credential made for that one action. Every change gets a receipt.

Who this is for: developers and platform teams setting up a coding agent to work with Edict.

Point your agent at these docs: they are also published as plain text at /llms.txt and /llms-full.txt, so an agent can read the whole setup in one fetch.

  • The edict CLI. Download and verification steps are published with its first public release.
  • You have an Edict account in your organization.

Run:

Terminal window
edict mcp install

Without --client, it configures every supported client that looks installed. To pick clients, pass a comma-separated list:

Terminal window
edict mcp install --client claude-code,cursor

Add --dry-run to see the change as a diff without writing anything. If your organization uses a different Edict address, pass it with --url or set EDICT_URL.

It adds an MCP server named edict that points at https://platform.edictlabs.ai/api/v1/mcp. The entry holds the URL only, never a token. Before changing a file it saves a backup next to it (NAME.edict-backup-TIMESTAMP). Running it again is safe. It refuses a config file that contains comments rather than rewrite it.

Client --client What it changes
Claude Code claude-code ~/.claude.json (or $CLAUDE_CONFIG_DIR/.claude.json), mcpServers.edict
Cursor cursor ~/.cursor/mcp.json, mcpServers.edict
VS Code vscode Code/User/mcp.json in your user config directory, servers.edict
Claude Desktop claude-desktop Writes no file. It prints the steps: in Claude Desktop, open Settings, Connectors, Add custom connector, name it Edict, enter the URL it shows, then Connect.

Codex: edict mcp install does not configure Codex. Add an MCP server in Codex’s MCP settings with the URL https://platform.edictlabs.ai/api/v1/mcp.

Restart your client after installing. The first time it connects, it opens your browser to sign you in to Edict. No token is written to your config files. In Claude Code you can also run /mcp.

The hook runs before each shell command your agent tries. Install it once per agent. --client is required.

Terminal window
edict hook install --client claude-code
Client --client File written Fails closed?
Claude Code claude-code ~/.claude/settings.json (or $CLAUDE_CONFIG_DIR/settings.json), a PreToolUse hook on Bash Yes, on Claude Code v2.1.295 or later. On older versions, a missing or failing hook lets the command run.
Codex codex ~/.codex/hooks.json (or $CODEX_HOME/hooks.json), a PreToolUse hook on ^Bash$ No. Codex has no fail-closed option.
Cursor cursor ~/.cursor/hooks.json, a beforeShellExecution hook Yes
VS Code (preview) vscode .github/hooks/edict.json in your repository, a PreToolUse hook Partly

Each hook runs edict hook --client NAME with a 10-second timeout, so edict must be on the PATH your client runs hooks with. The installer warns you if it is not. On a client that fails closed, a missing edict blocks every shell command.

Like mcp install, hook install backs up the file first, is safe to run again, supports --dry-run, and refuses a file with comments.

Per client:

  • Claude Code: restart your Claude Code sessions to pick up the hook.
  • Codex: Codex skips a new or changed hook until you trust it in /hooks. Admins can deploy the hook for everyone as a managed hook in requirements.toml (/etc/codex/requirements.toml on macOS and Linux). Managed hooks are trusted by policy and users cannot turn them off, but they still do not fail closed. Run edict hook --help for a full example.
  • Cursor: when the hook has nothing to say about a command, it answers “allow”. That does not override Cursor’s own approval or allowlist. Only a deny takes effect.
  • VS Code: hooks are in preview. The file goes in the repository, so commit it to share it with your team. --workspace DIR names the repository; by default it is the one holding the current directory. The hook applies to run_in_terminal and Bash tool calls.

When your agent tries to run a cloud or infrastructure tool, the hook blocks the command and tells the agent to call Edict’s request_change tool instead. It covers aws, aws-vault, terraform, tofu, terragrunt, kubectl, helm, pulumi, cdk, gcloud, az and eksctl. It sees through wrappers such as sudo, env, timeout, xargs and watch, and through sh -c, bash -c and zsh -c.

Read-only commands are blocked too. Your agent reads your cloud through Edict’s read tools instead. See MCP tools.

A few local-only forms are left alone: version and help, terraform and tofu fmt and validate, helm lint and template, and kubectl version --client.

The agent sees a reason that starts like this:

Edict steered this command away: … Call the Edict MCP tool request_change … This applies to read-only commands too … Do not retry the command another way. If the Edict MCP server is not connected, tell the user.

Every other command gets no answer from the hook, and your client’s normal permission flow applies.

The hook steers. It is not a security boundary. What keeps your cloud safe is that the agent holds no cloud credential. The next two sections are how you make sure of that.

Terminal window
edict preflight

Preflight checks whether this machine holds cloud credentials an agent could use to act around Edict. It tells you which path you are on:

  • Keyless: no credentials found. An agent here cannot reach your cloud on its own, so every change goes through Edict.
  • Governed path: credentials found. Edict is still the path where your rules, approvals and receipts apply, but an agent here could use those credentials to act around it.
  • Incomplete: nothing found, but some checks did not run.

It only checks whether things exist. It never reads a credential’s value. It looks at:

  • environment variables by name, such as AWS keys and session tokens, CI, GitHub and Terraform tokens, and Google Cloud, Azure and kubeconfig pointers
  • the default places in your home directory: ~/.aws, the GitHub CLI hosts.yml, Terraform credentials.tfrc.json, ~/.kube/config, ~/.config/gcloud and ~/.azure
  • whether an EC2 instance role is attached, through the instance metadata service. This is preflight’s only network request.

Options:

  • --identity: also runs your own aws sts get-caller-identity and shows only the account and ARN.
  • --json: prints the result as JSON.
  • --no-metadata: skips the instance metadata check.
  • --report: prints the report and opens a page where you can review it and send it to Edict. Nothing is sent until you select Send to Edict, signed in. Without a browser, it prints the link for you to open.

Nothing is stored, and nothing reaches Edict unless you use --report and confirm.

4. Keep the boundary in your cloud’s permissions

Section titled “4. Keep the boundary in your cloud’s permissions”

The hook points your agent the right way. Your cloud’s permissions are what hold the line.

  • The agent’s runtime should hold no AWS credentials. No access keys in environment variables, no profiles in ~/.aws, no instance role on the machine it runs on. Run edict preflight where the agent runs and aim for Keyless.
  • If a developer keeps a cloud tool on their machine, scope it read-only in IAM. Then even if an agent on that machine finds the credential, it can only read.

Add a short note to your repository’s AGENTS.md or CLAUDE.md so the agent knows the rule before it hits the hook:

## Cloud changes
Use the Edict MCP tools for anything that touches our cloud.
- To change or create cloud resources, call `request_change`. Do not run aws, terraform, kubectl or helm yourself, even for read-only commands.
- To look at cloud state, use Edict's read tools.
- If a request is pending, call `status` with its envelope_id later. Do not send it again.
- If a request is refused, follow the remedy in the refusal.
- If the Edict MCP server is not connected, tell me.

Remove the hook for each agent. Only Edict’s entry is removed. Every other hook and setting stays as it was.

Terminal window
edict hook uninstall --client claude-code

For VS Code, the file is deleted when nothing else is left in it.

Remove the MCP server:

Terminal window
edict mcp uninstall

Pass --client to remove it from specific clients only. For Claude Desktop and Codex, remove the Edict connector or server in the app’s settings.