- A malware check for the packages an agent installs or adds to a manifest.
- A dependency risk check for dependencies with known vulnerabilities.
- A secrets check for the content an agent writes and reads.
- A prompt injection check for instructions planted in prompts and tool output.
Malware check
The malware check fires when a governed agent installs a package or edits a manifest or lockfile to add one. The check looks up the package in the Endor Labs malware feed, the same intelligence that powers malicious package detection and Package Firewall. Only confirmed malware triggers the policy. Contested records and records under review do not. The check parses the packages out of the install command the agent runs. It recognizes the following package managers:- npm:
npm,pnpm,yarn,bun,npx, andbunx. - PyPI:
pip,python -m pip,poetry,pipenv,uv, anduvx. - Go:
go install,go get, andgo runwith a versioned remote module, such asgo run example.com/tool@v1.2.0. - NuGet:
dotnet add package,nuget, andpaket. - Packagist:
composer. - Crates:
cargo. - RubyGems:
gemandbundle. - OS package managers:
apk,apt,yum,dnf, andzypper.
sudo and env, and inline shells such as bash -c "npm install …".
The check also runs when the agent writes or edits a manifest or lockfile. It compares the file before and after the edit and checks only the packages the edit adds. See Supported manifests and lockfiles to review the files it reads. It skips npm dependencies that point to a local path, a workspace, a git source, or a URL.
The check judges the version the package manager would install. It looks up an exact version, a pinned manifest entry, or a lockfile entry at that version.
For an unpinned npm, PyPI, or Go install, or a version range in npm or PyPI, the check resolves the highest stable version the install or range allows. The policy then triggers only in the following cases:
- The feed flags the resolved version.
- The feed flags every version of the package.
- The feed flags a version newer than the resolved one, and the install would pick it.
- An unpinned install or a range in any other ecosystem, such as Cargo or RubyGems.
- A Maven entry without an exact version, such as a range, a
${property}reference, or an entry with no version. - An npm tag other than
latest, such asbeta. - A Go version query that isn’t a version number or
latest, such as a branch name orupgrade. - A Python install that allows prerelease versions, through
--pre,--allow-prereleases, or--prerelease allow, or through a specifier such aspkg>=1.0rc1. - A package with no known versions, a range that no stable version satisfies, or a version lookup that fails or doesn’t finish in time.
^5.0.0 doesn’t trigger on a record for version 4.4.2.
A malware violation includes the evidence your team needs to respond:
- The package name, version, and ecosystem from the install or edit. For an unpinned install or a range, the version is the one the check expects the install to pick. The version is empty when the check couldn’t resolve one.
- A summary of the malware report and the reasons the feed flagged the package.
- The feed source that flagged the package.
ecosystems list through the REST API. The valid tokens are npm, pypi, go, mvn, nuget, packagist, cargo, gem, apk, debian, and rpm, and Endor Labs rejects a policy with any other value. Maven has no install command, so mvn applies only to manifest and lockfile edits. The form doesn’t offer Maven, so set mvn through the REST API.
The out-of-the-box policy Malware: block installs of known-malicious packages is disabled by default. Enable it, or create your own malware policy, to turn the check on.
Create a malware policy
To create a malware policy in the Endor Labs user interface:- Select User menu > Policies & Rules from the left sidebar.
- Select Agent Governance.
- Click Create Agent Governance Policy.
- Under Policy Template, choose Malware under Secure Coding.
- Optional: Under Ecosystems, select the ecosystems to check. Leave it empty to check every ecosystem.
- Under Choose an Action, select Block, Alert, or Ask Permission.
- Under Name Your Policy, enter a Name, then click Create Agent Governance Policy.

<namespace> with the namespace that owns your Coding Agent Governance policies. Leave ecosystems empty to check every ecosystem.
Secrets check
The secrets check scans content the agent touches for secrets, such as cloud access keys, provider tokens, and private keys. By default a policy scans the content of file writes and edits. To also scan the files the agent reads, select Read under File Operations, or listFILE_OPERATION_READ with FILE_OPERATION_WRITE and FILE_OPERATION_EDIT in file_operations. A list of only FILE_OPERATION_READ scans reads only.
Read scanning is opt-in because it reads each file from disk. Detection uses the Endor Labs secret rules library, the same rules as secrets scanning. See Secret detection rules to browse the full library.
The scan runs on the developer’s machine, and the scanned content never leaves it. A secrets violation includes:
- The rule that fired, such as
aws-access-tokenorgithub-pat, with its human-readable name. - The line and column where the secret starts.
- A fingerprint that groups repeat findings of the same secret.
REDACTED. When a permitted operation runs, the follow-up event records that the operation happened without the file content.
Four more policy fields shape the check:
- Include File Patterns (
include_file_patterns) limits scanning to matching paths, and Exclude File Patterns (exclude_file_patterns) skips paths such as test fixtures or vendored directories. Exclusions apply after inclusions. An empty configuration scans every file the event covers. - Include Rule IDs (
include_rule_ids) limits the policy to specific detection rules, and Exclude Rule IDs (exclude_rule_ids) mutes rules whose matches are false positives in your codebase. Both match rule IDs such asaws-access-tokenexactly. Exclusions apply after inclusions.
secrets_check activity in place of malware_check in the malware example. Endor Labs rejects FILE_OPERATION_DELETE, because a delete writes no content to scan.
Two out-of-the-box secrets policies are disabled by default: Secrets: block writes that introduce a credential and Secrets: ask before reading a file that holds a credential. Enable them, or create your own secrets policy, to turn the check on.
Scan MCP tool calls for secrets
A secrets policy can also scan the arguments and results of MCP tool calls in Claude Code, Codex, Cursor, and GitHub Copilot. The policy form doesn’t offer this yet. Set the following fields on thesecrets_check activity through the REST API:
mcp_payloads: ListMCP_PAYLOAD_INPUTto scan tool arguments before the call runs, andMCP_PAYLOAD_RESPONSEto scan results after the call returns. An empty list scans no MCP calls.include_mcp_server_patternsandexclude_mcp_server_patterns: Optional regex lists matched against the MCP server name. Exclusions apply after inclusions. An empty configuration scans every server. The patterns apply only when the call names a server. Endor Labs always scans a call with no server name, or a sub-agent call that reports an ID instead.
Dependency risk check
The dependency risk check fires when an agent adds a dependency with a known vulnerability. It looks up each new package in Endor Labs vulnerability data and matches advisories at or above a severity you set. The default severity is high. The check runs at two points:- Install commands: The check parses the packages out of the command, the same way as the malware check.
- Manifest and lockfile edits: The check compares the file before and after the edit and checks only the dependencies the edit adds. See Supported manifests and lockfiles to review the files it reads.
beta, so it lists that package as not checked. In Maven, it can’t check an entry without an exact version, such as a range, a ${property} reference, a -SNAPSHOT version, or a dynamic Gradle version such as 1.+. Pin an exact version to have it checked.
Transitive dependencies
By default,include_transitives is off, and the check looks up only the dependencies an install command or manifest edit names. With it on, the check also looks up the packages each new dependency pulls in, using the dependency data Endor Labs stores for that package. The check follows the dependency graph and leaves out packages that only the dependency’s development dependencies pull in, such as test runners and linters. This also applies to go.mod edits. Other lockfiles already list every resolved package, so the check looks up every entry the edit adds, even when include_transitives is off.
What a dependency risk violation shows
When the check matches, the agent and developer see the vulnerable package, the advisory, its severity, and the fixed version when one exists. A transitive match names the direct dependency that brings it in and suggests a newer version of it. When no fixed version exists, the message suggests removing or replacing the package. A block also tells the agent not to install the vulnerable version another way, such as with--force. If the check could not cover every package, the first match lists the packages it did not check and the dependencies whose transitive packages it could not fully check.
Create a dependency risk policy
Create and edit dependency risk policies through the REST API. The policy form does not author them yet. The policy takes the following fields on itsdependency_risk activity:
ecosystems: Optional list of ecosystems to check. The supported values arenpm,pypi,go, andmvn, andmavenandgradlealso work for Maven. An empty list checks every supported ecosystem.min_cvss_severity: The lowest advisory severity that matches. ChooseSEVERITY_LOW,SEVERITY_MEDIUM,SEVERITY_HIGH, orSEVERITY_CRITICAL. Unset meansSEVERITY_HIGH.include_transitives: Set totrueto also check the packages each new dependency pulls in, except its development dependencies. Unset meansfalse.include_file_patternsandexclude_file_patterns: Optional regex lists that limit which manifests and lockfiles the check reads. Exclusions apply after inclusions.
ecosystems values, so a misspelled or uppercase value such as python or NPM matches nothing. Use the lowercase values above.
The following example creates a policy that asks before an agent adds an npm or PyPI dependency with a critical vulnerability.
Prompt injection check
The prompt injection check looks for text that tries to take over the agent, such as a README that tells the agent to ignore its instructions. It scans the prompt a developer submits and the output of the agent’s tools. The check runs fixed rules. A policy can also run a classifier. Both run on the developer’s machine and make no network call.Sources
A prompt injection policy names the sources it scans:- User prompt: The prompt the developer submits.
- MCP tool result: The result of an MCP tool call, including the error text of a failed call.
- Web content: A fetched web page or web search results.
- File read: A file the agent is about to read. The check scans it before the read.
- Shell output: The output of a shell command, including the error text of a failed command.
WebFetch and WebSearch tools.
Techniques
Each rule detects one technique. A policy acts on every technique unless you narrow it with include and exclude lists:- Instruction override: Text that tells the agent to drop its earlier instructions.
- Fake system marker: Text dressed up as a system or developer message.
- Role play: Text that gives the agent a new persona with no rules.
- Encoded text: An instruction hidden in an encoding. For example, base64, hex, URL escapes, HTML entities, look-alike letters, or letters split apart by spaces or symbols. The check also decodes an encoding inside another encoding.
- Hidden text: An instruction in invisible characters or an HTML comment.
- Exfiltration request: Text that asks the agent to send data somewhere.
- Counterfeit policy: Fake policy text that tells a checker the content is safe.
Confidence
Each rule has a confidence level for each source:- High: The rule stays under 1% false positives on benign test text for that source.
- Low: The rule can also match ordinary text, so it reports more false positives.
Classifier
The classifier scores text that no rule matched. It works on every source. A score at or above the cutoff creates one match with no technique. A classifier match never blocks. The check records it as an alert. Lowest Confidence and the technique lists apply to rule matches only. The policy form doesn’t offer the classifier yet. Turn it on through the REST API with thedetectors field.
What a prompt injection violation shows
A match shows the Technique ID, such asrole-play, the Confidence, and a Message that names the source and the number of places the technique appears. For example, a match reads Prompt-injection technique "instruction-override" found in a file read (2 places, low confidence). Endor Labs doesn’t store the scanned text, so the violation never shows it.
A classifier match shows no technique or confidence. Its Message names the source and the classifier score. For example, Text that looks like a prompt injection found in the user prompt (classifier score 0.93).
The check reads up to 256 KB of text in each scan. It reads a file from disk when the hook carries only the path, within the lines the agent asks for. It decodes JSON tool output of up to 1 MB first, so it scans each key and value on its own line.
Create a prompt injection policy
Choose Prompt Injection under Secure Coding in the policy form, or create the policy through the REST API. The form doesn’t show List Type or offer Ask Permission for this template. When you select a tool-output source with Lowest Confidence set to High, the form warns that the policy finds nothing there. Through the REST API, the policy takes the following fields on itsprompt_injection_check activity:
sources: The sources to scan. Choose one or more ofTEXT_SOURCE_USER_PROMPT,TEXT_SOURCE_MCP_TOOL_RESULT,TEXT_SOURCE_WEB_CONTENT,TEXT_SOURCE_FILE_READ, andTEXT_SOURCE_SHELL_OUTPUT. A policy needs at least one source.include_technique_ids: Optional list that limits the policy to specific techniques. The IDs areinstruction-override,fake-system-marker,role-play,encoded-text,hidden-text,exfiltration-request, andcounterfeit-policy. An empty list acts on every technique.exclude_technique_ids: Optional list of techniques to ignore, even when included.min_confidence: The lowest confidence that matches,FINDING_CONFIDENCE_HIGHorFINDING_CONFIDENCE_LOW. Unset meansFINDING_CONFIDENCE_HIGH. It applies to rule matches only.detectors: Optional list of the detectors to run. The values areDETECTOR_RULESandDETECTOR_CLASSIFIER. An empty list runs the rules only. The classifier scores only text that no rule matched. A list withDETECTOR_CLASSIFIERmust also includeDETECTOR_RULES.
Supported manifests and lockfiles
The malware and dependency risk checks read the following files when the agent writes or edits them. The checks skipbuild.gradle, because it is code rather than a manifest.
Actions
Secure coding checks use the same actions as every other Coding Agent Governance policy: Block stops the action, Alert records it, and Ask Permission pauses for the developer. The prompt injection check doesn’t offer Ask Permission, because a scan of text leaves no pending action to approve. Violations appear under Policy Violations next to the rest of your governance activity. See Actions to review what the developer and your security team see for each action.How the checks fit with other Endor Labs protection
Endor Labs catches malicious packages and secrets at more than one layer, and each layer covers a different point in the workflow:- Secure coding checks act in the agent loop, at the moment an agent installs a package, edits a manifest, or touches a secret.
- Package Firewall protects the registry path for every install in your organization, whether an agent or a person runs it.
- Secrets scanning finds secrets already committed to your repositories and pull requests.
Limitations
Be aware of the following limitations:- Checks run for supported agents on machines with hooks deployed.
- The malware and dependency risk checks never block an action they can’t complete. If a lookup fails or times out, or a file can’t be read or is larger than 10 MB, the action proceeds. When only the version lookup fails, the malware check still runs and judges the package by name.
- For an unpinned install or a range, the malware check resolves stable versions only. It reads the npm
latesttag as the highest stable version and ignores the npm--tagflag, so it can judge a different version than npm installs. - In Claude Code, the manifest and lockfile checks cover the
WriteandEdittools, notMultiEdit. - The dependency risk check ignores advisories without a CVSS score, disputed or withdrawn advisories, and malware advisories, which the malware check covers.
- The secrets check inspects content the agent touches in a session. It is not a repository-wide scan. Use secrets scanning for full-repository coverage.
- The prompt injection check can’t stop text that already reached the agent. It records matches in MCP tool results, web content, and shell output, but it can block only a file read or a user prompt.
- The hosted web search in Codex runs without a hook, so the prompt injection check doesn’t scan its results.
- The prompt injection check reads at most 256 KB of each text. It can miss a match past that point, so a clean result for a longer text is not proof that the text is clean.
- Like all Coding Agent Governance controls, these checks are guardrails for agent behavior, not a security boundary. See What Coding Agent Governance is (and isn’t) to review what these guardrails can’t stop.