Skip to content

dangerousPatterns config field is not wired #263

@laynepenney

Description

@laynepenney

Problem

ResolvedConfig has a dangerous_patterns field (from .codi.json dangerousPatterns) but there is no corresponding field in AgentConfig and no logic to check commands against these patterns before execution.

Expected Behavior

When a user configures dangerousPatterns (e.g., ["rm -rf", "DROP TABLE"]), the agent should:

  1. Check tool call arguments against these patterns before execution
  2. Require explicit user confirmation if a dangerous pattern is matched, even if the tool is in the auto-approve list

Proposed Approach

  1. Add dangerous_patterns: Vec<String> to AgentConfig
  2. In the tool execution path (before calling execute_tool), check if any argument matches a dangerous pattern
  3. If matched, bypass auto-approve and prompt for user confirmation
  4. Wire the field from ResolvedConfig in build_agent_config()

Related

PR #261 — Wire config options, context compaction, and auto-index on startup

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions