Polyguard
Fail-closed verification for AI-generated code across multiple programming languages.
Polyguard runs the real build and test tools for the languages it detects. It returns PASS only when every detected language has a recognizable test suite and all configured commands succeed. Missing tests, missing toolchains, timeouts, compilation errors, and failing tests return FAIL.
Install
python -m pip install polyglot-code-guard
Use
Run this inside the project directory:
polyguard verify
The normal verdict is intentionally one word:
PASS
or:
FAIL
For diagnostics:
polyguard verify --details
For automation:
polyguard verify --json
The process exits with code 0 for PASS and code 1 for FAIL.
Initial language support
| Language | Test command |
|---|---|
| Python | compileall, then pytest |
| Rust | cargo test --all-targets |
| Go | go test ./... |
| JavaScript / TypeScript | npm test; TypeScript projects also run tsc --noEmit |
| Java | Maven test or Gradle test |
| C# | dotnet test |
| PHP | PHPUnit |
| Ruby | RSpec or Rake test |
| Swift | swift test |
| C / C++ | CMake build and CTest when CTest is configured |
The project must contain a detectable test suite for each detected language. Polyguard deliberately does not treat the absence of tests as a successful result.
AI coding-agent skill
The repository includes SKILL.md with the mandatory agent workflow and output contract. The same skill instructions are included in the installed Python package as package data.
Important limitations
Polyguard is a test-execution gate, not a proof of program correctness. The quality of a PASS depends on the requirements and coverage of the tests. It does not generate comprehensive tests automatically in this first release.
The verifier executes project build scripts and tests. Do not run untrusted code on a machine containing secrets or sensitive files. Use a disposable container or virtual machine with restricted permissions and no privileged host mounts.
Language detection and test-runner conventions vary across ecosystems. This alpha release uses conservative heuristics; unsupported project layouts may require explicit configuration in a future release.
Development
python -m pip install -e ".[test]"
python -m pytest -q
python -m build
python -m twine check dist/*
Publishing
The publish workflow uses PyPI Trusted Publishing. Configure a pending/normal publisher in PyPI for:
- Owner: Furox-Art
- Repository: polyglot-code-guard
- Workflow: publish.yml
- Environment: pypi
Then create a GitHub release to publish. No long-lived PyPI API token is stored in the repository.
License
MIT
Metadata
Release files for polyglot-code-guard 0.1.0
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 |
|---|---|---|---|---|
| polyglot_code_guard-0.1.0.tar.gz | 9.0 kB | With provenance | Details for polyglot_code_guard-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| polyglot_code_guard-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for polyglot_code_guard-0.1.0-py3-none-any.whl |
Total release size: 18.4 kB
Release files / polyglot_code_guard-0.1.0.tar.gz
| Download URL | polyglot_code_guard-0.1.0.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd4f47c031a15e0067800720d4cb9b12b3fb05d3ba8d12f88590b1075f5d07c0
|
|
BLAKE2b-256 checksum How to use checksums |
b517ff3040d204c505b01e37fc0102d9547d1583589db0ebb29f958465bae50e
|
| 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 Nov 2, 2026.
Transparency logRelease files / polyglot_code_guard-0.1.0-py3-none-any.whl
| Download URL | polyglot_code_guard-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cdfd9444dcc334a901661b9281c91b69711d1be8adb72bf07fd472b6819287aa
|
|
BLAKE2b-256 checksum How to use checksums |
14871021d7ba384d349ea0c5b316e8e2c54faf6c0803bf9a01fcd3fd3b9748a0
|
| 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 Nov 2, 2026.
Transparency logSecurity for polyglot-code-guard 0.1.0
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
Both files in this release have been uploaded with provenance metadata.
Attestation for polyglot_code_guard-0.1.0.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 Nov 2, 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.