| name | fortinet:settings |
| description | Configure Fortinet Code Security plugin settings (enable/disable scanning globally or per repo) |
| user-invocable | true |
Fortinet Code Security Settings
Manage plugin settings for the Fortinet Code Security plugin.
Config File
Settings are stored in ~/.lacework/plugins/code-security.json.
Structure (v2):
{
"hooks": {
"mode": "pre-commit",
"enabled": true,
"overrides": [
{
"path": "/absolute/path/to/repo",
"enabled": false
}
]
}
}
hooks.mode — "pre-commit" (default, scans before git commit) or "post-task" (scans after every Claude Code task)
hooks.enabled — global kill switch for all scanning
hooks.overrides — per-repo overrides, matched by path prefix (longest match wins)
Legacy format (v1)
Older configs may use hooks.stop.enabled and hooks.stop.overrides. If hooks.mode is absent, treat as mode=post-task and use hooks.stop.* fields. When writing any change, migrate to v2 format.
Behavior
When the user asks to disable or enable scanning without specifying scope, ask:
Would you like to disable/enable scanning globally (all repos) or just for this repo (<current working directory>)?
If the user specifies scope directly, act without asking.
Actions
Show settings:
- Read
~/.lacework/plugins/code-security.json
- Display: scanning mode, global enabled status, any overrides
- Show the resolved state for the current working directory
Switch scanning mode:
- Read the config file (create if missing)
- If v1 format, migrate to v2 (move
stop.enabled → hooks.enabled, stop.overrides → hooks.overrides)
- Set
hooks.mode to the new value
- Write back the file
- Confirm: "Scanning mode switched to [mode]. Scans will now run [before git commit / after every task]."
Disable/enable globally:
- Read the config file (create if missing, migrate v1 if needed)
- Set
hooks.enabled to false or true
- Write back the file
- Confirm the change
Disable/enable for a specific repo:
- Read the config file (create if missing, migrate v1 if needed)
- Check if an override already exists for the repo path (normalize trailing slashes)
- If exists: update the
enabled value
- If not: add a new entry to the
overrides array
- Write back the file
- Confirm the change, showing the resolved state
Creating the config file:
If ~/.lacework/plugins/code-security.json does not exist:
- Create the directory:
mkdir -p ~/.lacework/plugins
- Write the default v2 config with the requested change applied
Resolution Logic
When determining if scanning is enabled for a directory:
- Check
hooks.enabled — if false, scanning is disabled globally
- Find all overrides where the directory path starts with the override's
path (prefix match)
- Pick the longest (most specific) matching path
- If a match is found, use that override's
enabled value
- If no match, fall back to the global
hooks.enabled value
- If the config file doesn't exist, scanning is enabled by default
Output
After any change, show:
Fortinet Code Security Settings updated:
- Scanning mode: pre-commit / post-task
- Scanning (global): enabled/disabled
- This repo (<path>): enabled/disabled (via override / via global default)
Important
- Always use absolute paths for overrides (use the current working directory)
- Normalize paths: strip trailing slashes before comparing or storing
- Do not add duplicate overrides for the same path — update existing entries
- Preserve any other settings in the config file when writing changes
- When migrating v1 to v2, preserve all existing overrides