Bulwark|Docs

Importing from Claude Code

If you already have permissions configured in Claude Code's settings.json, you can import them directly into Bulwark as policies. This lets you migrate your existing rules without recreating them by hand.

Finding Your Claude Code Permissions

Claude Code stores permissions in its settings.json file. The permissions block looks like this:

{
  "permissions": {
    "allow": [
      "Bash(npm run lint)",
      "Bash(npm run test *)",
      "Read(~/.zshrc)"
    ],
    "deny": [
      "Bash(curl *)",
      "Read(./.env)"
    ],
    "ask": [
      "Write(/etc/*)"
    ]
  }
}

You can paste either the full settings.json or just the permissions block.

How to Import

  1. Go to Settings → Policies
  2. Click Import from Claude Code
  3. Choose an input mode:

Paste JSON

Paste your Claude Code settings.json (or its permissions block) into the text area and click Parse Rules. Bulwark will extract all allow, deny, and ask entries and convert them into policies.

Write Rules

Enter rules one per line using Claude Code's rule syntax, then select the action (Allow, Deny, or Ask) from the dropdown. This is useful when you want to quickly add a few rules without constructing JSON.

Bash(npm run lint)
Bash(npm run test *)
Read(~/.zshrc)
WebFetch(domain:docs.example.com)

Lines starting with # are treated as comments and ignored.

  1. Review the parsed policies in the preview
  2. Click Import to create them

Supported Rule Formats

Built-in Tools

Claude Code RuleBulwark FieldExample
Bash(...)tool_input.commandBash(npm run *)
Read(...)tool_input.file_pathRead(./.env)
Edit(...)tool_input.file_pathEdit(src/*.ts)
Write(...)tool_input.file_pathWrite(/etc/hosts)
WebFetch(...)tool_input.urlWebFetch(domain:example.com)
Task(...)tool_input.agent_nameTask(Bash)

MCP Server Rules

MCP server rules use the mcp__ prefix:

RuleWhat it Matches
mcp__myserverAll tools from myserver
mcp__myserver__*All tools from myserver (explicit wildcard)
mcp__myserver__searchOnly the search tool from myserver

Wildcards and Patterns

PatternOperatorExample
Tool(exact)equalsBash(npm run lint) matches exactly
Tool(prefix*)starts withBash(npm run *) matches any npm run command
Tool(*suffix)ends withRead(*.env) matches files ending in .env
Tool() or Tool(*)anyBash() matches all Bash calls
Tool(a*b*c)regexComplex globs are converted to regex

WebFetch Domain Syntax

WebFetch(domain:example.com) is converted into a tool_input.url contains "example.com" rule, matching any URL on that domain.

What Gets Created

Each imported rule becomes a separate Bulwark policy with:

  • Name: Auto-generated from the action and rule (e.g., "Allow Bash: npm run lint")
  • Description: Notes that it was imported from Claude Code
  • Action: Matches the original allow/deny/ask section
  • Status: Active
  • Rules: An AND group matching the tool name and input specifier

Warnings and Errors

During parsing, Bulwark will surface warnings for:

  • Invalid JSON syntax
  • Non-array values in allow/deny/ask
  • Rules that couldn't be parsed

Successfully parsed rules are still imported even if some rules produce warnings.

Tip

After importing, review your new policies in the policy list. You can edit any imported policy to adjust its name, priority, or rules.

Next Steps