Using LyraShield AI Alongside Aider for Secure AI Coding
How to run LyraShield security checks alongside Aider today using the CLI and GitHub Action diff gate. Native MCP is a roadmap item Aider has not yet shipped.

On this page
You can use LyraShield AI alongside Aider today without waiting for native MCP support. Aider does not ship MCP integration yet, so this workflow uses the LyraShield CLI to scan your changes and a GitHub Action diff gate to enforce the same checks in CI. Native MCP is a roadmap item for Aider, and this post shows what that path will look like when it ships.
Aider edits files directly from the chat prompt, which is fast but means a risky edit lands in your tree before any review pane catches it. The vibe coding security guide frames this as unverified generation at scale. LyraShield AI is agent native AppSec for AI built software that follows a loop of Target to Scan to Evidence State to Fix Proposal to Retest to Assurance Report. Because Aider lacks native MCP today, the working integration is the CLI plus the CI gate, both of which need no Aider config change. Findings retain their recorded evidence states; independent verification requires a separate receipt. Current LyraShield tools record fix proposals and queue retests but do not edit code, create branches, or open pull requests.
1. Install prerequisites and authenticate
Install Node so the npx commands resolve, then run npx lyrashield login to store your credentials in a local file under your home directory. Nothing is committed to the repository, because credentials live in a per user file and the CLI never writes them into source. This matters for shared repos where a committed token would leak to every collaborator and to the git history. Confirm with npx lyrashield doctor that the server is reachable and the credentials resolve before you scan, because a failed login surfaces here instead of mid session. The Node.js downloads page is the canonical source for the runtime. Run login and doctor from the project root so any project scoped config is detected correctly, and re-run doctor whenever you suspect the connection has drifted. If you share a machine with teammates, note that the credentials file is per user, so each person runs login once rather than sharing a single credential file.
2. Run a CLI scan alongside Aider
The working integration today is the CLI. After Aider edits your files, run a scan from the terminal before you commit. This catches exposed secrets, vulnerable dependencies, and code risks that Aider generated, without needing any MCP wiring inside Aider itself. Run npx lyrashield scan from the project root, targeting the files Aider changed. The CLI returns findings you can triage before the edit reaches version control, which is the moment a risky change is cheapest to fix.
Keep the loop simple: Aider edits, you scan, you triage, you commit or fix. Because Aider has no review pane like an IDE, the CLI scan is your review step between generation and commit. Cross reference code findings against CWE Top 25 and dependency findings against OSV advisories so triage uses a shared vocabulary. If a finding flags a hardcoded secret, rotate it before commit rather than after, because a secret in git history is expensive to purge. The Model Context Protocol specification defines how servers expose tools, which is relevant once Aider ships native MCP, but you do not need it for the CLI path today.
3. Add the GitHub Action diff gate
Wire the workflow into CI so every pull request is scanned on the changed diff, not the whole repository. The LyraShield GitHub Action runs on pull request events, targets the changed files, and emits SARIF output you can ingest. Approval-gated fix proposals record intended remediation for human review, so the action blocks only on new findings while a human approves any fix. The GitHub Actions security hardening guide describes the permissions and secret handling to apply. Run the action on every pull request so review cannot be skipped under deadline pressure, and pin your action versions so an upstream change cannot alter your gate. Store any token the action needs as a GitHub Actions secret rather than in the workflow file, and give the job the minimum permissions it needs, because a scanner job does not need write access to your repository contents.
name: LyraShield Security Check
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
pull-requests: write
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: ecryptoguru/lyrashield-ai@v2
with:
fail_on_severity: HIGH
This gate works whether or not Aider ever ships MCP, because it runs in CI on the diff, independent of the editor. SARIF output integrates with GitHub code scanning so findings appear in the pull request view, and the GitHub docs for SARIF upload describe the required security-events: write permission.
4. What native MCP will look like when Aider ships it
Aider does not have native MCP support today, and being honest about that matters. Two GitHub feature requests are open: issue 2525 asks for MCP client support, and issue 4506 asks for native MCP server and Agent Mode in the CLI. Two community pull requests attempted to add it: PR 3672 added a rough stdio client via a custom YAML config, and PR 3937 used LiteLLM’s MCP bridge with the standard JSON server schema. Both were closed without merging, so neither is in shipped Aider. The Aider configuration docs cover the .aider.conf.yml file but do not document an mcp-servers key, because that key exists only in the unmerged PRs and third party guides, not in the released tool.
When Aider ships native MCP, the LyraShield integration path will be to register the server in Aider’s config using the pinned command npx -y @lyrashield/mcp@0.2.2 for local stdio or the remote endpoint https://app.lyrashieldai.com/api/mcp with a Bearer token prefixed lsk_. The server exposes scan, lyrashield_list_targets, and lyrashield_get_findings tools that the Aider agent can call inline, the same tools other editors use today. Until then, the CLI and GitHub Action in this post are the supported ways to run LyraShield alongside Aider. Track the Aider GitHub issues if you want to adopt native MCP the day it merges.
5. Add an agent rules snippet
Aider has no rules file, so convey conventions through the chat prompt at the start of a session. A short snippet you paste tells the agent to run a check before completing a feature and to attach evidence to the pull request.
Before finishing a feature, run a LyraShield security check and attach the findings link to the pull request. Never commit secrets. If a high severity issue is found, stop and ask for review.
Because Aider has no persistent rules file, paste this snippet at the start of each session or save it in a local note you copy from. The snippet keeps the security loop explicit: Aider edits, you scan via CLI, you triage, you commit with evidence. Treat the snippet as the contract your session follows, even without a rules file to enforce it.
| Integration path | How it works today | Needs Aider MCP | Status |
|---|---|---|---|
| CLI scan | npx lyrashield scan from terminal | No | Working now |
| GitHub Action | Diff aware gate on pull requests | No | Working now |
| Native MCP | Server registered in Aider config | Yes | Roadmap, not shipped |
Why pair Aider with LyraShield AI
LyraShield AI gives you release assurance for AI built apps through a target, review, evidence, fix, retest, report loop. For Aider it contributes agentic pentest, software composition analysis, and secrets scanning, then writes each finding to an immutable assurance record that separates detection from proof. Approval-gated fix proposals record intended remediation for human review, so a human stays in the loop before anything ships. The platform is live with open registration, so you can create an account and pair it with the AI app security checklist tool. For a review focused companion, see the Windsurf security workflow post. The honest framing is the credibility win here: Aider lacks native MCP today, so you use the CLI and CI gate, and you adopt native MCP when Aider ships it rather than pretending a dead config path works.
Frequently asked
Does Aider support MCP servers today?
No. Aider does not ship native MCP support. Open feature requests exist on GitHub (issues 2525 and 4506) and community pull requests (3672 and 3937) were closed without merging. Use the LyraShield CLI and GitHub Action until Aider ships native MCP.
How do I run a LyraShield scan alongside Aider without MCP?
Run npx lyrashield scan from your terminal after Aider edits. The CLI works standalone with no MCP integration needed. Run it before you commit to catch exposed secrets, dependency advisories, and code risks that Aider generated.
What does the CLI doctor command verify?
It verifies that the server is reachable, your credentials resolve, and the local config is valid, so you can confirm setup without a manual guess before you run a scan.
Does Aider have a rules file for agent instructions?
No. Aider has no dedicated rules file. You convey conventions through the chat prompt at the start of each session, and you can paste a short security snippet each time.
Related posts
- Aider App Security Checklist for AI Pair Programming
A security checklist for reviewing apps built with Aider covering MCP server config, secrets, dependencies, and verifiable evidence with LyraShield AI.
- Aikido vs LyraShield for AI Built App Security
Aikido unifies SAST SCA secrets and cloud scanning from code to runtime; LyraShield wraps AI app testing in a release assurance loop with approval gated fixes.
- Secure an Antigravity Built App Before Launch
A release review checklist for Antigravity apps covering data exposure, config, secrets, dependencies, and independent launch evidence before you ship.