Skip to content

EA1: YAML block-list and JSON quoted-key wildcard grants are never detected #445

Description

@yashrajp22

Summary

The EA1 wildcard-tool-access pattern only matches when the * value sits inline after the key on the same starting position. The two most idiomatic real-world encodings of exactly this grant have never matched — in the pre-#417 pattern or the current one:

Case 1: YAML block list

tools:
  - "*"

The block-sequence dash is not part of the pattern, so the value branch fails at -. This is the idiomatic frontmatter form for agent/skill manifests (e.g. allowed-tools: style lists).

Case 2: JSON quoted key

"tools": ["*"]

The pattern's key prefix (?:tools?|permissions?)\s*: requires the colon immediately after the key word, so the closing quote of a JSON key breaks the match. MCP server configs and agent manifests are JSON — the quoted-key form is arguably the most common encoding of a wildcard tool grant.

Also related: an inline list where the wildcard is not the first element is missed today:

tools: ["search", "*"]

(the pattern requires the * right after the opening bracket).

Proposed fix

Scope note: the block-list branch intentionally matches only the first item. A wildcard buried later in a multi-item block list stays out of scope until there's evidence it occurs in practice — matching arbitrary item positions across lines widens the false-positive surface for markdown lists.

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