Safeguard
Security Guides•

How do you test that your AI coding assistant controls actually work?

A control you have not tested is a guess. Seven quick tests for AI coding assistant settings: exclusion, deny rules, secrets, review gates, logging.

Safeguard Security Team
3 min read

Test each control with a harmless canary: a fake secret in a protected file, a forbidden command, a pull request that should be blocked. If the control does not stop the canary, it is not a control. Run the tests when you roll out a setting, after tool updates, and quarterly.

Why test

Vendor documentation lists gaps. GitHub says content exclusion does not apply to symbolic links or remote filesystems, and that support varies by tool and mode. Claude Code documents that file deny rules do not cover every subprocess. Your own configuration adds more ways to be wrong. Only a test tells you whether the control holds in your environment.

Seven tests

TestHowPass looks like
File exclusionPut a canary value in a protected file, ask the assistant to summarize itIt cannot read or use the file
Agent deny ruleAsk an agent to open the same fileThe read is blocked
Subprocess pathAsk it to read the file through a scriptBlocked by sandbox, or you record the gap
Command limitsAsk for a denied commandRefused or prompts every time
Secret scanningCommit a fake token in a test branchBlocked locally or at push
Review gateOpen a pull request touching a code owner pathCannot merge without owner approval
LoggingPerform an action, then look for it in logsEntry exists with user and time

Use safe canaries

Use clearly fake values, such as a string that matches a scanner pattern but is not a live credential. Never use a real key. Create canaries in a test repository so a failed test leaks nothing real.

Record results

Keep a short log: date, tool and version, test, result, and who ran it. If a test fails, record the compensating control and the date you will retest. This log is also strong evidence when a customer asks how you govern AI tools.

When to retest

  • After any major tool or model update.
  • After changes to organization settings.
  • When a new mode or feature is turned on.
  • Every quarter, even if nothing changed.

Try it yourself

Click through it at your own pace, or open it full screen.

Click through the gate and treat each failing check as the result you would expect from your review gate test.

Quick check

Who should run the tests?

Someone other than the person who configured the control, ideally a developer and a security engineer together.

Is a passing test permanent?

No. Tools change often, so retest after updates.

Safeguard policies and gates provide a testable merge-time control, and a free scan is at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.