- Home
- Skills
- Code Quality & Review
- Safe AI Coding: Permission Gate and Code Review
More screenshots
Works with the AI Agents you already use
Safe AI Coding: Permission Gate and Code Review
The agent calls a class that does not exist, or leaves `// ...
$9.99
Safe AI Coding: Permission Gate and Code Review
Example session with this skill installed
Review my changes before I commit. I edited the order controller and added a chart script to the layout.
- Read your context and instructions
- Compiled the safe ai coding
Gate mode: balanced (asks only before actions that can cause harm)
Summary
I scanned the change and read every changed line through the AI lens and the human lens.
Not ready: 5 HIGH and 1 WARN. The worst one is the ownership check removed from show(): any customer can open another customer's order. The scanner cannot see that kind of business rule.
1. Pattern and symbol scan (diff-check.sh HEAD)
HIGH app/Http/Controllers/OrderController.php:18 SQL built from request input: SQL injection; use bound parameters
> $rows = DB::select("SELECT * FROM orders WHERE email = '" . $request->input('email') . "'");
HIGH app/Http/Controllers/OrderController.php:20 AI placeholder: code was left out ('rest of the code...'); the file is incomplete
> // ... rest of the code unchanged
HIGH config.local.php:1 Stripe live key
> STRI****
WARN resources/views/layout.blade.php:1 script loaded from another site without integrity (SRI): if that host is compromised, its code runs for every user; pin the version and add integrity and crossorigin, or serve a local copy
3 file(s), 12 added line(s) scanned. Findings: 3 high, 1 warn, 0 info.
Syntax: 3 file(s) checked.
2. Findings after the full read
| # | Severity | Where | Problem | What goes wrong | Fix | Found by |
|---|---|---|---|---|---|---|
| 1 | HIGH | OrderController.php:12 | user_id filter removed from show() | Any signed-in customer opens /orders/123 and sees someone else's order | Restore Order::where('user_id', $request->user()->id)->findOrFail($id) | Human lens |
| 2 | HIGH | OrderController.php:18 | Email concatenated into SQL | ' OR '1'='1 returns every order | DB::select('... WHERE email = ?', [$email]) | Scan |
| 3 | HIGH | OrderController.php:19 | OrderTotals is not defined anywhere in the project | Fatal error on the first search | Use the existing totals code, or decide with me | AI lens |
| 4 | HIGH | OrderController.php:20 | Code replaced by "rest of the code unchanged" | The method body is lost | Write the full method | Scan |
| 5 | HIGH | config.local.php:1 | Live Stripe key in a file git will pick up | The key leaks with the next push | Move it to .env, and rotate the key in Stripe | Scan |
| 6 | WARN | layout.blade.php:1 | CDN script without SRI, added without asking | A compromised CDN runs code for every visitor | Pin the version and add integrity and crossorigin, or serve a local copy | Scan + gate |
For each changed endpoint
show(): reachable by every signed-in user. It returns any order by ID. It must return only that user's own orders.
search(): reachable by every signed-in user. It returns every matching order across all customers. Decide who may search whose orders.
Verdict: Not ready
- Ran:
diff-check.shand its syntax check of 3 files. - Not run: tests. No test covers
OrderController. - Permission requests: none in this session.
Next steps
- Rotate the Stripe key now. It may already be in your shell history or a backup.
- Say "fix 1-5" and I will fix them in this change, then run the review again.
- For the chart script, I will ask before adding third-party code. I recommend a local copy.
Connects securely to your tools. The creator never sees your data.
About this skill
AI coding agents fail in predictable ways. The code runs but breaks the business rule. An ownership check goes missing. The agent calls a class that does not exist, or leaves // ... rest of the code unchanged where real code used to be. It reports "tested" when nothing ran. The agent itself can also run something harmful on your machine, or follow instructions hidden in a file it reads.
Safe AI Coding closes those gaps, in any language and any repository.
What it does
1. Permission gate: it asks before harm, and says what the harm is
Before a risky step, the agent stops and shows a permission block:
- the exact command and where it runs
- why the task needs it
- what can go wrong (the worst realistic outcome first)
- whether it can be undone
- a safer option
Then it waits for your yes. Your request for the task does not count as approval, and a "no" stands.
It covers:
- package installs
- database writes and migrations
- git push, reset and clean
- deleting files
- reading secrets
- sending data out
- adding CDN scripts and other third-party code
- writing code that could open a security hole or leak data
2. Two gate modes
balanced(default): asks only before steps that can cause harm, and does everything else without stopping.strict: asks before every command and file change.
3. Build mode: it copies your codebase, not generic framework knowledge
The agent restates the business rule, then finds the closest existing example in your repository and matches its naming, validation, error handling, transactions and authorisation checks. It makes the smallest change, then proves it with syntax checks, tests and edge cases.
4. Review mode: a scan plus two lenses
- Scan: a scanner checks every added line for:
- secrets and real-looking keys (printed masked)
- SQL, command and path injection, XSS, SSRF
- weakened auth, CSRF, CORS and TLS
- destructive migrations
- weakened tests
- AI leftovers: elided code, pasted chat text, conflict markers
- install hooks, unpinned dependencies, and CDN scripts without SRI
- open Firebase rules, row level security switched off, secrets in
VITE_/NEXT_PUBLIC_variables - LLM features that run model output as code or SQL
- classes, methods, views, routes and imports that do not exist
- AI lens: a full read for invented symbols, scope creep, copied defects and gamed tests.
- Human lens: a full read as the teammate who maintains the code and the person who owns the business rule.
You get a findings table with file:line, the concrete failure, the fix, and a verdict: Ready, Ready with notes or Not ready.
5. Scan mode for a fresh clone
Before an agent works in a repository you did not write, the scan finds what could steer or attack it:
- instruction files, including copies inside
vendor/andnode_modules/ - agent settings that auto-approve tools
- the repository's own git config and hooks
- install hooks and custom package registries
- symlinks that leave the repository
- hidden unicode
- committed
.envfiles and keys
6. Report mode, only when you ask
A polished PDF covering:
- what was wrong: symptom, root cause, impact and evidence
- what was fixed, with before/after code
- the checks and the scan counts
- the permission log
It comes in English or Roman Urdu.
7. Alerts, so you never miss a question (optional)
Start a task, switch to another app, and the skill tells you when the agent is waiting:
-
Sound: it repeats until you answer. It has its own on/off switch, and you can use your own
.wav,.mp3or.wma. -
Popup (Windows): it appears when the editor is not in front and shows the same thing the editor shows:
- for a permission: Allow, Deny and "Deny with a message"
- for a question: every option, multi-select and an "Other" text answer
You answer right there. It never takes the keyboard focus and has no default button, so a stray Enter cannot approve anything.
-
Mobile: a push to your phone through Claude Code's own notifications.
8. Per-project switch, self-test and commit guard
off/on/statusswitch the skill off for one project and keep it everywhere else.self-testruns 125 cases that prove the scanners catch attacks and stay quiet on good code.- An optional commit guard blocks commits with HIGH findings.
Commands
| Say | What happens |
|---|---|
build <task> | Writes the change the safe way, then reviews it |
review [base] | Reviews the current change |
scan | Checks a repository before real work |
report | PDF report of the session |
mode strict / mode balanced | How often the gate asks |
off / on / status | The skill in this project |
alerts on / off / test, alerts sound <file> | Sound, popup and mobile push |
self-test | Proves the scanners work |
Where it stops
- Pattern scans cannot judge intent or business logic. A clean scan means "no obvious red flags", not "safe". The human-lens review is there for that, and a person should still read the diff.
- It changes your agent's settings only on your command (
alerts on,off), and shows you the change first where it affects every project or your team. - Hard enforcement still belongs in tool permissions, branch protection and CI.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.
Automated scans may miss obfuscated attacks. Performance is intentionally slower during high-risk tasks. Requires manual human verification for business logic and intent.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 18 days ago
- Accounts
Example
- Software
GitBashPerland
Node.js
Python
- Optional
- Google ChromeorMicrosoft EdgeWindows PowerShell
On Windows, use Git Bash. The browser makes the PDF report; PowerShell shows the alert popup.
Permissions
Allowed Hosts
File Scopes
Terminal: runs git, bash and perl locally, plus php -l, node --check and python for syntax checks. It never runs code from the repository it scans. Read files: the current repository, to scan and review changes. Write files: only the temp folder while scanning. The rest is written only on the user's command: the PDF report (report), the two alert hooks in ~/.claude/settings.json and ~/.claude/safe-ai-alerts.json (alerts on/off; settings.json is backed up first), .claude/settings.local.json (off/on), and .git/hooks/pre-commit (commit guard). Environment variables: reads TMPDIR, and LOCALAPPDATA and the Program Files paths to find the temp folder and the browser. Optional settings: SAFE_AI_PDF_BROWSER, SAFE_AI_PDF_TIMEOUT. Nothing is sent anywhere. No network access.