Agent Config Guard
Agent Config Guard is an offline, static security scanner for coding-agent and Model Context Protocol (MCP) configuration files.
It helps maintainers review repository-controlled instructions and MCP configuration before those files reach an AI agent with access to a shell, source code, credentials, or external tools.
Safety properties
- Never starts an MCP server.
- Never makes a network request.
- Never evaluates configuration commands.
- Reads only recognized configuration and instruction files under the selected directory.
- Uses deterministic rules and produces reviewable findings.
- Has no runtime dependencies.
What it detects
| Rule | Severity | Condition |
|---|---|---|
CFG001 |
High | Invalid JSON that tools may interpret inconsistently |
CFG002 |
Medium | Configuration larger than the scan limit |
CFG003 |
Medium | Non-UTF-8 configuration |
SEC001 |
Critical | Credential-like field containing an inline value |
SEC002 |
Critical | Value matching a high-confidence credential pattern |
NET001 |
High | Non-local remote MCP URL using HTTP |
MCP001 |
High | MCP process launched through a command shell |
MCP002 |
High | Package-runner invocation without an exact version |
MCP003 |
Medium | Automatic package-install confirmation |
MCP004 |
Critical | Privileged container or host control access |
INS001 |
High | Invisible or bidirectional Unicode control characters |
INS002 |
High | Suspicious overrides, shell downloads, or credential instructions |
These findings are review signals, not proof of malicious intent. See the threat model for scope and limitations.
Quick start
Python 3.10 or later is required.
The 0.1.1 distribution is being prepared for its first PyPI publication. Until that publication is verified, install a built wheel or run from a checkout as shown below. The following index command applies after publication:
python -m pip install kosh-config-guard
agent-config-guard .
Run directly from a checkout without installing:
PYTHONPATH=src python -m agent_config_guard .
PowerShell:
$env:PYTHONPATH = "src"
python -m agent_config_guard .
To build and test a local distribution, follow the publishing guide.
The installed command supports agent-config-guard --version.
The PyPI distribution name is kosh-config-guard to distinguish this
project from similarly named packages. The executable remains agent-config-guard
and the Python import remains agent_config_guard. PyPI has accepted the pending publisher configuration for this name;
the package itself is not published yet.
Integrate with GitHub Actions
See the CI integration guide and the copyable workflow. The example uses a pinned scanner version, read-only repository access and a SARIF artifact. Its PyPI installation step requires the package to have been published first. It scans recognized agent/MCP configuration, not every source file in the repository.
Reports and CI gates
agent-config-guard . --format json --output reports/agent-config-guard.json
agent-config-guard . --format sarif --output reports/agent-config-guard.sarif
agent-config-guard . --fail-on high
agent-config-guard . --exclude tests/fixtures/unsafe
Exit codes:
0: scan completed and no finding met the failure threshold.1: at least one finding met the failure threshold.2: invalid command-line input.
Files scanned
.mcp.jsonandmcp.jsonsettings.jsonandsettings.local.jsonAGENTS.mdCLAUDE.mdcopilot-instructions.md
Common dependency, build, virtual-environment, and version-control directories are excluded.
Additional relative paths or globs can be excluded explicitly with repeatable --exclude options. Exclusions should be narrowly scoped and reviewed in pull requests.
Responsible use
Scan only repositories you own, maintain, or are authorized to assess. Do not place real credentials in test fixtures or bug reports. If you discover a security problem in this project, follow SECURITY.md.
Contributing
Rule proposals should include a safe fixture, a triggering fixture, tests, a remediation, and a false-positive discussion. See CONTRIBUTING.md.
License
Apache License 2.0. See LICENSE.
Metadata
Release files for kosh-config-guard 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kosh_config_guard-0.1.1.tar.gz | 16.2 kB | With provenance | Details for kosh_config_guard-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kosh_config_guard-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for kosh_config_guard-0.1.1-py3-none-any.whl |
Total release size: 26.9 kB
Release files / kosh_config_guard-0.1.1.tar.gz
| Download URL | kosh_config_guard-0.1.1.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c97c100464d991104ff102c7aa582e2810dc19ea8845f3eb35a43cc4628b4137
|
|
BLAKE2b-256 checksum How to use checksums |
5c66b9a6587e3688c4ec07cd38c7ae62ed009a13e077d2ec74792a52d2d5305e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logRelease files / kosh_config_guard-0.1.1-py3-none-any.whl
| Download URL | kosh_config_guard-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
03514b214c6b1e0dad8c8ad8209abaf7fe24d3e8cfa0f2b7e1be48cc6d048743
|
|
BLAKE2b-256 checksum How to use checksums |
e53eb4aabe100f2d154e282ae379064124b7c9cc6e4ec603d2a653c4089f76ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logSecurity for kosh-config-guard 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for kosh_config_guard-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.