Skip to content

OpenClaw MCP security workflow

Integrate LyraShield AI with OpenClaw via MCP and GitHub Action to verify builds, upload SARIF and enforce diff aware checks.

LyraShield MCP integration with OpenClaw
On this page

Follow the current openclaw integration guide and manually merge the server entry, preserving existing settings. Authenticate local stdio separately with npx -y lyrashield@0.2.14 login --oauth and use @lyrashield/mcp@0.2.12. Use pinned CLI commands for documented config or skill installs; marketplace plugins remain separately gated. Restart the client, confirm discovery, then call lyrashield_list_workspaces for authenticated read-only access. CLI doctor does not establish client authentication or scan completion.

You can connect OpenClaw to LyraShield AI over MCP to get target aware scans, findings with explicit evidence states and reviewable fix proposals inside your normal agent loop. In this guide you will configure local stdio using pinned npx -y @lyrashield/mcp@0.2.12 plus remote at https://app.lyrashieldai.com/api/mcp inside ~/.openclaw/openclaw.json, verify tool discovery, run a scoped inline check and wire a diff aware GitHub Action gate that uploads SARIF for code scanning.

OpenClaw is built to run many tools in parallel and to coordinate long lived sessions. That parallelism accelerates vibe coding and also expands attack surface quickly, which is why verification close to generation helps. Keep the vibe coding security guide open as your policy reference, then map findings to OWASP Top 10 and CWE Top 25 so triage has a shared vocabulary. Teams that generate large microservice surfaces in one session benefit most from this pairing, because otherwise review struggles to keep up with generation speed.

LyraShield follows a loop of Target to Scan to Evidence State to Fix Proposal to Retest to Assurance Report. A retest-confirmed outcome requires a fresh applicable retest and fix proposals never create a branch or pull request automatically.

1. Prerequisites and workspace baseline

You need Node.js 24 or newer, OpenClaw CLI, Git and a LyraShield login. Run lyrashield login --oauth for local stdio. For remote mode, use OpenClaw’s MCP OAuth flow so the config does not contain a token.

LyraShield v1 is designed to cover agentic pentest plus SCA plus secrets plus GitHub Action plus SARIF. Its current MCP flow can generate and record a fix proposal and queue a retest; editing code, creating a branch and opening a pull request remain developer-controlled steps. For protocol context, see Model Context Protocol.

Quick sanity steps:

node -v
npm view @lyrashield/mcp version
ls ~/.openclaw/openclaw.json
echo $LYRASHIELD_API_KEY | head -c 8

Keep a sibling checklist handy like OpenClaw app security checklist for fix patterns that match your generated framework stack. That checklist turns a finding with an evidence state into a concrete remediation suggestion, such as adding auth middleware or upgrading a dependency with a known advisory.

Define your target naming early. LyraShield treats target as the unit of verification, so staging OpenClaw app, production api or preview deployment id are all valid. Clear naming prevents confusion when you later share reports and when the CI job uses target auto.

2. Configure LyraShield MCP server in OpenClaw

OpenClaw stores MCP servers under mcp.servers inside ~/.openclaw/openclaw.json. It supports stdio for local and streamable-http for remote, plus toolFilter for least privilege. You can configure via CLI or by editing the json directly.

CLI options:

openclaw mcp add lyrashield --command npx --arg -y --arg @lyrashield/mcp@0.2.12
openclaw mcp add lyrashield-remote --url https://app.lyrashieldai.com/api/mcp --transport streamable-http --auth oauth
openclaw mcp login lyrashield-remote

JSON option with tool filtering:

{
  "mcp": {
    "servers": {
      "lyrashield": {
        "command": "npx",
        "args": ["-y", "@lyrashield/mcp@0.2.12"],
        "toolFilter": {
          "include": [
            "lyrashield_scan_target",
            "lyrashield_get_findings",
            "lyrashield_list_targets",
            "lyrashield_generate_fix_plan",
            "lyrashield_verify_fix"
          ]
        }
      },
      "lyrashield-remote": {
        "transport": "streamable-http",
        "url": "https://app.lyrashieldai.com/api/mcp",
        "auth": "oauth",
        "toolFilter": {
          "include": [
            "lyrashield_scan_target",
            "lyrashield_get_findings",
            "lyrashield_list_targets"
          ]
        }
      }
    }
  }
}

The canonical reference lives in OpenClaw integration guide. Keep toolFilter.include tight so the agent sees only the tools required for this workflow.

If you share one OpenClaw host across projects, keep authentication in OpenClaw’s OAuth credential store and scope LyraShield access to the intended workspace.

3. Verify connection and list security tools

Run openclaw mcp doctor lyrashield --probe and openclaw mcp doctor lyrashield-remote --probe. If local fails, confirm Node can resolve npx and that the LyraShield OAuth credential store is current. If remote needs authorization, repeat openclaw mcp login lyrashield-remote.

Ask OpenClaw to enumerate tools:

Prompt: List MCP servers from mcp.servers and tools from lyrashield and lyrashield-remote.
Show transport type, command or url and filtered tool list.

Expected:

lyrashield (stdio via npx -y @lyrashield/mcp@0.2.12):
- lyrashield_scan_target(targetId, mode)
- lyrashield_get_findings(workspaceId)
- lyrashield_list_targets(workspaceId)
- lyrashield_generate_fix_plan(findingId)
- lyrashield_verify_fix(findingId)

lyrashield-remote (streamable-http at https://app.lyrashieldai.com/api/mcp):
- lyrashield_scan_target, lyrashield_get_findings, lyrashield_list_targets

For supply chain context, skim OSV database and for workflow gating see GitHub Actions docs. These help you interpret combined appsec plus dependency results. Seeing matching tool lists across transports confirms auth flows for both local and remote paths.

4. Run an inline security check from OpenClaw

With tools listed, run a scoped scan without leaving OpenClaw. Keep scope tight so feedback arrives fast and evidence stays relevant. Narrow scope also prevents the agent from scanning large monorepos that include unrelated services you did not intend to verify in this run.

Prompt for OpenClaw agent:
Use lyrashield_scan_target for target staging-openclaw-app.
Scope: src/app/api, src/lib.
Exclude: .next, node_modules, generated.
Return only findings with evidence states with CWE, evidence, file and line, severity.
Include OWASP mapping when present.
Save report id for PR gate.

A useful answer should contain finding id, severity, recorded evidence state, CWE, file plus line, evidence snippet, limitations and suggested patch location. Prioritize retest-confirmed findings only when a clean retest exists, while retaining detected and inconclusive items for triage. Refer to OWASP Top 10 and CWE Top 25 for category background.

Since v1 includes secrets scanning alongside SCA, a single call can surface both hardcoded secrets and vulnerable packages. Treat inline scanning as early signal and keep PR gating as mandatory, because local checks can be skipped when developers are rushing to meet a demo.

A fix proposal records remediation intent; it does not edit code, open a branch or create a pull request. Apply the change through the approved development workflow, then queue and poll the retest.

5. Wire a diff aware GitHub Action gate

Local OpenClaw verification is fast, but PR enforcement is required for teams. Wire the official LyraShield GitHub Action in diff aware mode and upload SARIF.

name: lyrashield security gate
on:
  pull_request:
    paths:
      - "src/**"
      - "app/**"
      - "packages/**"
  push:
    branches: [main]

jobs:
  security:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      security-events: write
    steps:
      - name: LyraShield diff scan
        uses: ecryptoguru/lyrashield-ai@v2
        with:
          fail_on_severity: HIGH

Require the security job in branch protection. Pair MCP for authenticated product inspection with the runner-local Action for advisory CI checks. For reusable workflow patterns, see GitHub Actions docs. SARIF annotations keep changed-file signals visible where developers review code, but they do not replace a recorded LyraShield scan, evidence state or retest receipt.

6. Add agent rules for consistent secure coding

Add a local rules file that OpenClaw loads at session start, such as openclaw.md or .openclaw/rules.md. This file makes secure behavior the default.

# OpenClaw security rules

- Before marking a task done, call lyrashield_scan_target on changed scope.
- Surface findings with their evidence states, CWE, file evidence and limitations.
- For high severity findings, use lyrashield_generate_fix_plan for read-only guidance, have a developer apply the reviewed change, record the proposal and queue a retest.
- On PRs, ensure lyrashield security gate passed and SARIF uploaded.
- Reference OWASP Top 10 and internal vibe coding security guide in PR body when relevant.
- Never log raw secrets. Use the LyraShield local credential store or OpenClaw MCP OAuth.

This encodes the loop Target to Scan to Evidence State to Fix Proposal to Retest to Report as daily behavior. Store it in version control so new OpenClaw sessions inherit the same guardrails. Consistent rules across clones also mean that when OpenClaw runs in autonomous mode, it still follows the same verification steps a human developer would have taken.

Stage OpenClaw behavior LyraShield verification Review signal
Generation Generates APIs, workers and UI in parallel N/A Session log
Inline check Calls lyrashield_scan_target with toolFilter allowed set Findings with evidence states plus SCA plus secrets with evidence Finding id with CWE and file path
PR gate Pushes diff to GitHub Diff aware scan plus SARIF plus fail on high GitHub required check green
Fix flow Developer applies a reviewed remediation Recorded proposal plus server-owned retest Retest outcome and scan reference

Why pair OpenClaw with LyraShield

OpenClaw gives you parallel tool use and strong session control, but parallelism without policy can ship risks faster than reviews catch them. LyraShield contributes findings with evidence states with evidence instead of noisy warnings, maps each to OWASP Top 10 and CWE Top 25, adds dependency context from OSV database patterns and keeps the workflow inside MCP so you avoid context switching. The v1 scope stays honest: agentic pentest plus SCA plus secrets plus GitHub Action plus SARIF, with broader automation on the roadmap but not billed as live today. For OpenClaw teams that generate large surfaces quickly, this combination provides fast local signal plus mandatory PR protection, which is the minimum bar for keeping agent generated apps trustworthy.

Finish by running AI app security checklist on the release candidate and confirming your json matches OpenClaw integration guide. When ready to evaluate managed verification, create an account at LyraShield AI and keep the required security check as your source of truth for verification.

Frequently asked

Where does OpenClaw store MCP config?

Global ~/.openclaw/openclaw.json under mcp.servers. Use command and repeated --arg flags for local stdio or transport streamable-http for the remote endpoint.

How do I filter exposed tools?

Use toolFilter.include with exact LyraShield tool names and toolFilter.exclude for unwanted globs.

Does OpenClaw support bearer auth for remote MCP?

Yes. Prefer auth oauth with openclaw mcp login so a token is not stored in the config.

How do I verify the LyraShield connection works in OpenClaw?

Confirm server and tool discovery inside the client, then call lyrashield_list_workspaces. CLI 0.2.14 doctor checks a separate local surface; it is not client authentication or scan evidence.

Stay in the loop.

We store your email for product updates and scorecard notifications. No sharing, no marketing blasts.