Skip to content

Title: [Feature] Add whitelist mode — define allowed query shapes per tool #7

Description

@mosw

Body:
Currently Agent-Warden uses a blacklist approach — blocking known destructive SQL patterns (DROP, DELETE without WHERE, TRUNCATE, etc.).
A whitelist mode would let users define exactly which query shapes are allowed per tool. For example:
pythonallowed_patterns = {
"analytics_tool": ["SELECT"],
"write_tool": ["SELECT", "INSERT", "UPDATE"]
}

Any query not matching the allowed shapes gets rejected automatically.

Why this is better for production:

Simpler to maintain — define what's allowed vs catching every bad pattern
Safer failure mode — unknown queries get rejected instead of potentially slipping through
Easier to audit and explain to security teams

Inspired by community feedback on defense-in-depth strategies for agent SQL access.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions