Discovering and fixing risks from coding to delivery
Solution Architecture
The solution uses a design of four defense layers plus two closed loops. The four layers cover security policy and identity, Agent runtime protection, code risk detection and remediation, and delivery gates plus security operations. The runtime control loop completes “identify, evaluate, allow / ask / deny, execute, record” before every tool call, while the risk remediation loop spans “discover, verify, remediate, review, deliver, feed back.” Security scanning is responsible for finding code issues, and permissions plus isolation are responsible for constraining Agent behavior. The two are complementary and cannot substitute for each other.

Solution Advantages
Advantage 01: Protects Both How the Agent Operates and Whether the Code Is Secure
Permissions, Hooks, human confirmation, and isolated environments answer whether an Agent may read, modify, or execute. Qoder Security and enterprise scanning tools answer whether the code contains vulnerabilities. The two categories of control are configured independently and reinforce each other, avoiding the situation where code is scanned while high-risk operations go unchecked, or where the Agent is restricted but complex code defects still go undetected.
Advantage 02: Security Shifts Left to Every Code Change Rather Than Waiting for the End of the Pipeline
L1 quickly identifies high-risk patterns during coding, L2 performs semantic scanning on incremental code when a task ends, L3 traces cross-file data flows before a commit, and full-repository scanning covers a broader scope on demand. Different depths match different development rhythms, so issues are found at the stage where remediation costs least.
Advantage 03: Semantic Understanding and Multi-Agent Verification Improve Detection Quality for Complex Risks
Qoder Security does not only match fixed rules. It also uses code context to understand whether input is controllable, whether data genuinely reaches a dangerous sink, and whether in-house wrapper methods are effective. It then verifies findings from multiple angles through multiple Agents, helping teams focus on the risks most worth resolving.
Advantage 04: Deterministic Policy Enforcement and Human-in-the-Loop Together Guard High-Risk Operations
Tool calls follow allow / ask / deny permission decisions, and high-risk actions clearly show the user the operation content and its impact scope. A PreToolUse Hook can inspect or rewrite parameters before execution and use deterministic rules to block dangerous commands, sensitive paths, and unauthorized outbound transfers, avoiding sole reliance on natural language prompts.
Advantage 05: Brings MCP and External Tools Under Unified Extension Governance
Enterprises can centrally manage the access patterns and permitted scope of non-native MCP Servers, and combine project-level approval, tool-level permissions, extension source restrictions, and credential management to control the supply chain and data access risks introduced as Agent capabilities expand.
Business Scenarios
Scenario 01: Protecting AI-Generated Code as It Is Written
Security starts at the first line of code, without waiting for issues to enter the repository.
- Customer problem: When AI generates code quickly, it may use dangerous calls, write in sensitive information, or copy insecure implementations. If problems are found only at the pipeline stage, the developer has already switched context and remediation costs rise accordingly.
- Trigger: The Agent writes code in the current task.
- Agent actions: L1 Static Check inspects code as it is written and feeds findings directly into the session context, so the Agent resolves obvious risks in subsequent edits.
- Deliverables: Dangerous calls, hardcoded secrets, and other obvious risks are found and corrected at the point of writing.
- Completion definition: Basic security checks become a default part of coding, and obvious risks do not enter the code repository.
- Human Gate: The developer reviews the final diff for confirmation.
Scenario 02: Reviewing the Code Change Once the Task Is Complete
Judging not only whether code looks like a vulnerability, but understanding whether the risk genuinely holds.
- Customer problem: Risks such as SQL injection, command execution, and sensitive information leakage depend on input sources, call relationships, and business context. Pure rule matching easily produces false negatives or noise.
- Trigger: A single development task ends.
- Agent actions: L2 Lightweight Scan performs semantic analysis on the incremental code from this task, judging whether external input is controllable and whether dangerous calls are genuinely reachable. Multiple Agents cross-verify to improve detection quality, and the Agent proposes and applies remediation.
- Deliverables: Scan results with risk location, root cause, and actionable remediation suggestions.
- Completion definition: Issues are resolved while the developer is still familiar with this change, making security review part of the task rather than a follow-up ticket.
- Human Gate: The developer reviews the remediation diff.
Scenario 03: Investigating Deep Cross-File Risks Before Committing
Completing one final security check with full context before code leaves the local environment.
- Customer problem: Real vulnerabilities may span multiple functions, files, and in-house wrapper methods. Single-file inspection cannot confirm the data propagation path and struggles to judge whether in-house filtering logic is effective.
- Trigger: Before Commit / Push.
- Agent actions: L3 Deep Scan performs cross-file data flow analysis on incremental code, traces the complete path from external input to the dangerous sink and cross-verifies it, identifies complex issues that look safe locally but are risky in combination, and the Agent assists with remediation.
- Deliverables: A high-confidence list of complex risks verified for reachability, together with remediation.
- Completion definition: Complex vulnerabilities are handled before code leaves the local environment and do not enter the PR or downstream delivery chain.
- Human Gate: The developer or code owner reviews and then commits securely.
Scenario 04: Conducting a Systematic Security Audit on Key Repositories
Expanding from a single code change to a more complete view of project risk.
- Customer problem: Legacy systems, internet-exposed applications, major releases, and key projects need review beyond a single change, while traditional scan results are scattered and verification plus remediation take significant effort.
- Trigger: The audit scope for a key project or repository is defined.
- Agent actions: Full Scan audits a specified directory, commit range, or repository, aggregates risk severity, affected locations, and remediation suggestions, and generates a visual report to support assessment, with the Agent assisting remediation.
- Deliverables: A trackable, assignable, and reviewable remediation checklist plus a project risk baseline.
- Completion definition: Findings are converted into an actionable, verifiable remediation plan.
- Human Gate: The security team assesses findings and tracks remediation, with testing and human review.
Reference Practice
Practice Name
Qoder Security x A Large Software Enterprise: Building a Development Security Closed Loop from Agent Coding to CI Gates
Practice Background
- Customer or industry: A large software enterprise with multiple development teams, complex code repositories, and a unified DevSecOps platform.
- Original workflow: Security scanning was concentrated mainly at the CI stage, so developers received feedback late locally. Agent permissions and MCP configuration were maintained by each team on its own.
- Core problems: Security feedback lagged, verifying complex vulnerabilities was costly, Agent behavior boundaries were inconsistent, and scan plus remediation evidence was scattered.
- Pilot scope: Two core code repositories, one development team, the Qoder Desktop / CLI entry points, and one CI pipeline.
Practice Design
- How events enter: Developers initiate coding tasks through Qoder Desktop / CLI, and CI runs security checks of an agreed scope through the Agent SDK or CLI.
- How the control layer routes: Organizational identity, project policy, tool allow / ask / deny, the MCP allowlist, and the PreToolUse Hook jointly determine whether execution is permitted.
- How the Agent executes: L1 scanning is enabled locally, L2 runs when a task completes, and L3 runs for high-risk changes or before push. CI retains its existing SAST, SCA, and Secrets gates.
- How results are written back: Qoder Security outputs semantic analysis and multi-Agent verification results, and the PR is linked to finding numbers, scan results, and the security conclusion.
- How failures are routed back: Tool calls, scan reports, code changes, gate results, and exception status flow into the audit and vulnerability management platform.
- Where humans make decisions: Security staff review major risks and exceptions, and developers review the remediation and test diffs generated by the Agent before committing.
Practice Workflow
| Step | Event | Role | Action | Write-Back Evidence |
|---|---|---|---|---|
| 01 | Threat modeling and baseline design | Security team plus development platform team | Identify Agent, data, tool, code, and supply chain risks, and define the control baseline | Threat model and control matrix |
| 02 | Identity and permission integration | IT plus development platform team | Integrate SSO, and configure roles, tool permissions, and bypass restrictions | Identity and permission acceptance records |
| 03 | Extension and runtime boundary governance | Security team | Establish the MCP allowlist, Hook interception, and runtime isolation policies | Extension inventory and policy test records |
| 04 | Layered scanning activation | Development team | Enable L1 / L2 / L3 by scenario, and establish usage rules for Full Scan | Scan configuration and sample results |
| 05 | Remediation and review closed loop | Developers plus security staff | Agent-assisted remediation, running tests, diff review, and security review | Remediation commits and review conclusions |
Practice Outcomes
- Closed loop delivered: A complete chain formed from Agent permission evaluation, coding-time scanning, and pre-commit deep review through remediation review to CI gates and audit write-back.
- Validated capabilities: Identity and permission control, Hook interception of dangerous operations, MCP access governance, L1 / L2 / L3 layered scanning, remediation diff review, and coordination with existing security tools.
- Data and evidence: Effectiveness can be assessed continuously through policy hits, scan stages, finding disposition, remediation commits, gate results, and audit records. Specific figures follow the disclosure scope authorized by the customer.
- Out-of-scope areas: Expanding code language and repository coverage, improving network and file isolation, and promoting cross-team reuse of risk knowledge, policies, and remediation experience.
Recommended Product Bundle
| Product / Capability | Role in Solution | Entry Point | Customer Capabilities | Product Link |
|---|---|---|---|---|
| Qoder Security | Code security core | Desktop / CLI | L1 / L2 / L3 layered scanning, full-repository scanning, verification, remediation suggestions, and reports | https://qoder.cn/security |
| Qoder Desktop | Developer security workbench | Desktop | Use permissions and security scanning while understanding, generating, modifying, and reviewing code | https://docs.qoder.cn/user-guide/what-is-qoder-cn |
| Qoder CLI | Terminal and pipeline entry point | CLI / CI/CD | Run controlled Agent tasks and security checks locally, in scripts, and in pipelines | https://docs.qoder.cn/cli/overview |
| Qoder Agent SDK | Foundation for embedding security capabilities | SDK / API | Configure tool scope, permission callbacks, Hooks, and security scanning options for the enterprise platform | https://docs.qoder.cn/cli/sdk/overview |
| Cloud Agents | Isolated hosted execution | API / Cloud Runtime | Run long tasks in an isolated environment and track execution through sessions and event streams | https://docs.qoder.cn/cloud-agents/overview |
| Enterprise Organization and Extension Governance | Unified policy control plane | Admin Console | SSO, organization permissions, MCP Access Control, extension management, audit, and usage governance | https://docs.qoder.cn/account/teams/get-started |