Open-source, local-first static analysis and PR gates for Python, TypeScript/JavaScript, Go, Java, Kotlin, PHP, Rust, Dart, C#, C++, and Shell. Finds dead code, security issues, secrets, quality regressions, and AI-code mistakes.
pip install skylos==4.43.2 Copy PIP instructions
Website | Docs | Repo Map | Quick Start | GitHub Action | VS Code Extension | Real-World Results | Benchmarks | Roadmap | Contributing
Skylos is an open-source static analysis CLI for Python, TypeScript, JavaScript, Java, Go, Kotlin, PHP, Rust, Dart, C#, C++, Shell, and deployment config. It runs locally by default and can also be used as a CI/CD PR gate.
Use Skylos when you want one command to check a repo or pull request for:
Each command answers a different question. The source scan requires PATH. Bracketed paths on verify, suite, defend, and clean default to the current directory. suite and defend require a directory; verify and clean also accept a file.
Run skylos --help for this chooser, skylos --help for one command, and skylos commands for the command-family map.
The report commands have different gate and network behavior:
pip install skylos skylos . The default scan focuses on dead code. Run every main source analyzer, including security, secrets, quality, dependency, and AI-defect checks, with -a:
skylos . -a Run only evidence-backed AI defect checks with:
skylos . --ai-defects Verify a repository, file, or range before an agent hands it to review:
skylos verify . --file src/app.py --range 40:75 --project-context For a directory such as ., the AI-defect scan covers the selected tree. The separate behavior result models supported Python working-tree changes against Git HEAD; it is not the scope selector for the AI-defect scan. Dependency hallucination checks are enabled for path targets and can query package registries; use --no-dependency-hallucinations to disable those lookups. High/critical security findings (category: "security") and hard-coded secrets (category: "secret", value redacted) in the selected file/range also fail verification; use --no-security for the AI-code-only verdict. Interactive terminals get a human report. Redirected stdout and -o produce the versioned JSON result.
skylos verify schema version 2 returns pass, fail, or incomplete. incomplete means a requested proof could not be established, such as a missing local TS/JS import, computed namespace member, unsupported language-local API check, or parser surface that Skylos could not prove; it exits 2 unless --no-fail is set. The coverage object lists detected languages, expected checks, language support, missing checks, completed/skipped checks, checked references, and deterministic skip reasons. Declared third-party dependencies and recognized Node built-ins are outside the local TS/JS API proof; their references are counted in out_of_scope_references and do not make a clean verification incomplete. Unknown bare imports still require review.
Deterministic local/workspace API verification currently covers Python, TypeScript/JavaScript, Go, and Java without executing target code. PHP, Rust, Dart, C#, Kotlin, and Shell retain their existing static-analysis coverage, but their local API proof is reported as unsupported and therefore incomplete. See AI Code Verification Coverage.
Create a local AI hallucination contract for repo-specific generated-code truth. skylos verify auto-discovers .skylos/ai-contract.yml:
skylos contract init skylos contract inspect skylos verify . Test a running agent against deterministic response and tool-use scenarios:
skylos agent init skylos agent test --allow-contract-endpoint Create a project config with thresholds, ignores, template hooks, and vibe dictionary extensions:
skylos init Create a starter local rule pack:
skylos rules init skylos rules validate .skylos/rules/local.yml skylos rules list --json skylos rules list cross --json skylos rules list --packs --json skylos cache stats Generate a GitHub Actions PR gate:
skylos cicd init git add .github/workflows/skylos.yml git commit -m "Add Skylos CI gate" git push Need more commands? Read the CLI Reference.
skylos preflight checks the built artifact itself against the repository's declared GPU fleet. This is separate from the SKY-GPU* source scan, which checks Dockerfiles, CUDA build settings, and TensorRT packaging intent before the artifact exists.
Declare every machine that receives the same release:
# .skylos/gpu-targets.yml version: 1 targets: - name: inference-t4 vendor: nvidia driver: "535.104.05" compute_capability: "7.5" platform: "linux/amd64" The canonical filename is .skylos/gpu-targets.yml; the same schema is also accepted as .skylos/gpu-targets.yaml.
Then inspect a local build. Skylos uses a trusted system cuobjdump, takes a private snapshot, and never loads or executes the artifact:
skylos preflight build/app To make the command argument-free in CI, bind it to a project-relative artifact with a strict release receipt:
{"version": 1, "artifact": "build/app"} Save that file as .skylos/release.json, then run skylos preflight. For requests that reach report generation, terminal output is concise and redirected output is schema-versioned JSON. Argument or adapter errors can be plain text and exit 2.
cuobjdump can report several code-object groups, identified by the producer label in its selected executable fatbin. Skylos requires a compatible route for every reported group. A PTX-only route stays UNKNOWN because static inspection cannot prove that the deployment driver will JIT it successfully. The overall result is FAIL if any target or required check fails; otherwise it is UNKNOWN if any result is unknown, and PASS only when all results pass.
Version 1 proves the local artifact identity, Linux ELF platform, selected executable-fatbin architecture routes, a static packaged $ORIGIN CUDA runtime route, and documented CUDA driver-family compatibility. It does not prove runtime execution, workload correctness, memory demand, performance, nonselected or relocatable fatbins, or per-kernel symbol parity. Windows PE runtime import proof is not implemented. Digest-pinned OCI references are accepted as identities but are never pulled or started, so the CLI always reports UNKNOWN for them; trusted callers can supply digest-bound inspection facts through skylos.preflight.run_preflight(...).
skylos sbom . writes declared dependency licenses into CycloneDX, and skylos sbom . --format spdx-json writes an SPDX 2.3 SBOM. Licenses come from lockfiles and installed package metadata, offline. Unknown or ambiguous values (such as BSD) stay NOASSERTION rather than being guessed. --license-lookup opts in to a deps.dev query. To block licenses in -a scans, set a policy:
[tool.skylos] license_deny = ["GPL-*", "AGPL-3.0-only"] license_severity = "HIGH" Violations are reported as SKY-SCA-LIC001. See License compliance.
Install local hooks so the agent is checked while it works, not after:
skylos agent install-hooks # Claude Code (.claude/settings.json) skylos agent install-hooks --codex # Codex (.codex/hooks.json) skylos agent install-hooks --cursor # Cursor (.cursor/hooks.json) After each edit: verifies only the changed lines (security, secrets, AI-code mistakes) and tells the agent what to fix. Before a file read: blocks files that contain hard-coded secrets. Before a package install: blocks hallucinated or typosquatted packages. At stop: blocks "done" while issues the agent added are still open. Hooks fail open, log to .skylos/hook.log, and merge with your existing hooks. --uninstall removes only the Skylos entries. See Agent-loop hooks for the contract, latency, and limits.
Create .skylos/standards.md with the guidance you want agents to follow:
# Coding standards - Keep functions focused and handle exceptions explicitly. - Add a focused test when changing behavior. Then install the project skill and choose any Skylos quality rules to enforce:
skylos agent install-standards --enforce SKY-L002 skylos agent install-hooks --codex # use --cursor for Cursor, or omit for Claude Code skylos agent check-standards . # run this project-wide check in CI The installer writes SKILL.md files for Codex, Cursor, and Claude Code. Agent skills provide guidance; the hooks and project-wide check enforce the selected built-in quality rules. See project standards for the generated files, rule selection, and coverage limits.
Runtime guardrails are the WAF; Skylos is the SAST. skylos discover scans Python and TypeScript/JavaScript for recognized LLM integrations (provider SDKs, agent frameworks including the OpenAI Agents SDK, Claude Agent SDK, and Google ADK, MCP servers and their tools, direct HTTP calls to LLM APIs or OpenAI-compatible gateways, plus agent tools, prompt sites, and input sources). skylos defend checks the guardrails around those detected integrations deterministically, in the local process, with no model in the loop. It emits evidence by default and becomes a CI gate only when a threshold flag or policy supplies gate criteria.
skylos discover . # inventory LLM integrations and agent tools skylos defend . # score guardrails (13 weighted checks) skylos defend . --format md -o evidence.md # auditor evidence report + attestation skylos defend . --format sarif -o defend.sarif # GitHub code scanning upload skylos defend . --fail-on critical # CI gate: exit 1 on critical gaps skylos defend . --owasp-framework agentic # report against OWASP Agentic ASI Top 10 These commands do not inspect integrations in other languages. If discovery finds no supported integration, defend returns an empty inventory; do not treat the resulting score by itself as proof that an unsupported or unrecognized agent implementation has guardrails.
Per integration it verifies: dangerous output sinks (eval/exec/subprocess), agent tool scope and typed schemas, prompt-injection exposure (delimiters, untrusted input paths, RAG context isolation), output validation, PII filtering, and model pinning — plus ops checks (logging, cost controls, rate limiting) scored separately so they never inflate the security score.
Static pre-deployment verification complements runtime controls (gateways, policy engines, human approval flows); it does not replace them. Full guide: docs/agent-verification.md.
Skylos separates generated-code truth, static agent guardrails, and observed runtime behavior:
Create .skylos/agent-test.yml, then test a live OpenAI-compatible endpoint:
skylos agent test --observations agent-observations.json skylos agent test --observations agent-observations.json \ --format json --output agent-results.json Version 1 deterministically checks exact response substrings, required, allowed, and forbidden tool calls, tool arguments and sequence, maximum call count, explicit refusals, and explicit source IDs. Missing typed evidence is incomplete, never pass; exit codes are 0 pass, 1 violation, and 2 incomplete/invalid. Tool selection and final-answer source-ID checks are separate one-turn scenarios: Skylos records local replayable evidence but never executes tools returned by the target agent. Offline observations are marked as unverified fixtures rather than runtime proof.
For an authenticated remote endpoint, keep the destination and secret choice in the trusted CLI invocation:
skylos agent test --endpoint https://agent.example.com/v1/chat/completions \ --allow-remote --auth-env MY_AGENT_API_KEY Full guide: docs/agent-behavior-testing.md.
Skylos is not a replacement for every specialized scanner. It is a local-first repo and PR checker that puts several common review checks behind one CLI.
skylos agent verify . and skylos agent test record replayable artifacts under .skylos/runs/ and print the run directory in table output. JSON output includes the same harness summary under the harness key.
Use skylos agent replay .skylos/runs/ to validate and inspect a saved run without making LLM calls. Add --format json when another agent or CI job needs machine-readable status. A valid replay exits 0; an invalid or corrupt artifact set exits 1 with issue codes. Replay output includes schema_version so CI and agents can detect artifact-contract changes. Replay checks internal consistency and corruption; artifacts are not signed and are not proof against an actor that can rewrite the entire run directory.
The current harness state is observable and replay-validated. It is not yet a resume mechanism for continuing interrupted verification runs.
# Core static analysis pip install skylos # LLM-powered agent workflows pip install "skylos[llm]" # Ruff Python linting through `skylos lint` pip install "skylos[lint]" # Ed25519 verification for `skylos verify-verdict` pip install "skylos[verdict]" # All published optional extras pip install "skylos[all]" Container image:
docker pull ghcr.io/duriantaco/skylos:latest docker run --rm -v "$PWD":/work -w /work ghcr.io/duriantaco/skylos:latest . --json --no-provenance The unqualified image uses Python 3.14. Runtime-specific tags are also published for Python 3.11 through 3.14, so container scans can match a local or CI parser exactly:
docker run --rm -v "$PWD":/work -w /work ghcr.io/duriantaco/skylos:latest-python3.13 . --json --no-provenance If a Python file cannot be parsed, Skylos reports analysis_errors, omits the grade, and exits with code 2 instead of treating the skipped file as clean.
See Installation for source installs, container usage, and optional dependencies.
Run skylos init to add these sections to pyproject.toml:
[tool.skylos] exclude = ["node_modules", "dist"] [tool.skylos.templates] # security = ".skylos/templates/security.md" # quality = ".skylos/templates/quality.md" # security_audit = ".skylos/templates/security_audit.md" # review = ".skylos/templates/review.md" [tool.skylos.vibe] extra_phantom_names = ["verify_enterprise_auth"] extra_phantom_decorators = ["tenant_admin_required"] extra_credential_names = ["tenant_signing_secret"] extra_network_timeout_calls = ["vendor_sdk.fetch"] [tool.skylos.dead_code] entrypoints = [] [[tool.skylos.dead_code.entrypoints]] type = "method" name = ["create", "pre_hook", "post_hook"] parent = { name = "Main", base_classes = ["Application"] } path = "src/**" reason = "project framework lifecycle hook" [tool.skylos.contribution] collect_local_signals = false contribute_public_corpus = false structural_signatures_only = true include_source = false Template files extend Skylos' built-in prompts; they do not replace the JSON-only output contract or untrusted-code safety rules. Vibe dictionary extensions let teams teach Skylos about local fake-auth helpers, project credential names, sensitive files, and network calls that must set timeouts. Dead-code entrypoints let teams mark proprietary framework classes, lifecycle methods, and decorator-registered functions as live using precise rules for type, name, path, decorators, base classes, and parent classes. Rules must include a symbol selector such as name, decorators, base_classes, or parent; path and module only narrow the match. Contribution signals are off by default; when enabled, Skylos records local structural accept/dismiss/learn events under .skylos/contribution/ without raw source.
By default Skylos discovers [tool.skylos] in pyproject.toml by walking up from the scan path. To use a dedicated TOML config, pass --config-file PATH or set SKYLOS_CONFIG_FILE; standalone files may use either [tool.skylos] or top-level [skylos]. Synced Skylos Cloud policy keeps its protected precedence over repository-controlled config. The top-level [tool.skylos].exclude list applies to the main scan and commands such as skylos debt and skylos clean; pass --exclude for command-local additions or --include-folder to override an excluded folder.
C# dead-code findings are conservative: in a complete executable or web application scan, unreferenced public types and methods are low-confidence candidates; library APIs, protected members, and known framework or configured entry points remain externally reachable. C# source-file reachability is not implemented. Quality scanning detects statements after unconditional return, throw, break, or continue in a direct block; it is not full control-flow analysis. Security coverage includes selected tainted-input sinks and generic secret scanning of .cs files when --secrets or -a is enabled. Interpolated raw-string expressions are not yet followed by C# taint analysis. SCA inventories direct NuGet PackageReference entries in .csproj files. Only unconditional exact Version pins ([version]) without local Update/Remove mutations, not VersionOverride or centrally managed versions, can be checked against advisories. Ordinary NuGet version values are minimum bounds, so without a resolved lockfile their installed versions and vulnerability status remain unknown. Transitive packages are not inventoried.
Java security analysis follows directly implemented request-data helpers in same-package files or source files identified by exact imports or fully qualified names under a verified local source root. Helper reads are bounded and reject symlinks; no Java code or build scripts are executed. This is not full classpath or recursive helper analysis. Unknown helpers are not assumed to be request sources or sanitizers.
C++ analysis covers .cpp, .cc, .cxx, .hpp, .hh, and .hxx. The first release reports only apparently unused file-local free functions. Without a build configuration, it cannot fully resolve templates, overloads, macros, or external usage; these findings are a conservative heuristic, not a proof of C++ deadness. Ambiguous .h files and C files are not analyzed as C++.
Java weak-hash checks also follow local algorithm variables and values loaded through java.util.Properties from literal classloader resources. Resource lookup stays within the matching src/main/resources or src/test/resources directory. Missing resources, unsupported loaders/layouts, conflicting branch values, and unresolved mutations remain unknown. Properties are used only as crypto evidence, never to prove a security guard or choose a safe branch. This does not resolve arbitrary runtime classpaths, JAR resources, or environment overrides.
TypeScript and JavaScript dead code analysis recognizes package.json entry fields, including bin. For targets under dist/ or out/, it checks the matching src/ location first, then the package root, before the declared output. This also covers dist/bin/palee.js mapping to bin/palee.ts and dist/src/index.js mapping to src/index.ts. If both source locations exist, the src/ mapping keeps priority; unrelated files are not treated as entries.
For ESM build scripts invoked by package scripts, Skylos also follows top-level esbuild calls using unchanged constants, spreads, templates, Node path helpers, and simple literal-array maps. Build scripts are never executed. Nested build calls and filesystem-generated entry lists remain unsupported and may still produce unused-file findings.
VitePress configs at .vitepress/config.* and .vitepress/config/index.* are recognised as development entrypoints for .js, .ts, .mjs and .mts. Other files in .vitepress still need a reference or another entrypoint rule. Existing directory conventions such as scripts/ work with native Windows separators too; this does not add general discovery of commands in CI workflows.
Vue single file components (.vue) are skipped by source analysis, including when passed explicitly. Skylos does not yet parse their or blocks; separate JavaScript, TypeScript and backend source files are still analyzed. Existing browser script and event references in templates are unaffected.
Go dead-code and security checks require the native skylos-go engine. If Skylos discovers Go files but cannot run that engine, the report is marked incomplete, no grade or clean result is produced, and the CLI exits with status 2. Run skylos doctor to verify engine availability and configure SKYLOS_GO_BIN when using a separately built engine. The official GitHub Action builds the matching native engine automatically.
See Rules Reference for rule families and scanner scope.
Skylos has checked-in regression benchmarks for dead code, security, quality, and agent review. These are strict regression gates, not broad proof that any tool is universally state of the art.
For methodology, commands, competitor rows, and caveats, see BENCHMARK.md.
An experimental Jev runner can blindly score the pinned jev-1.13.0 typed decision model against the checked-in 124 dead-code labels or the frozen skylos-benchmarks corpus. It withholds labels and review reasons from the request, retains golden label IDs locally for exact classifier comparison, and repeats the test with answer-signaling identifiers neutralized when that can be done without changing fixture semantics. An offline comparator now reports label-by-label corrections, regressions, abstentions, and unsafe removals against a frozen Skylos result. Live mode sends fixture source to TypeSafe, requires an explicit flag and a separate TYPESAFE_API_KEY; it supports bounded, resumable runs and records request versus local contract-validation latency. Normal Skylos scans need no Jev key. We ran a paid six-request Jev-only fresh holdout on 33 frozen labels: 26/33 decisions at confidence 0.8, 24/26 correct among those decisions, and no known-used symbol classified as unused. A paired paid cascade run on the same holdout kept F1 at 0.72 while reducing broad-verifier calls from 8 to 4; it did not improve classification. See the dead-code benchmark guide. The 59-label same-run comparison reports total accuracy for pure Skylos (57.6%), LLM-only (69.5%), the original Jev precheck router (67.8%), and the initial Jev judge mode (88.1%). After two safety fixes, a separate paid judge-only run on the final code scored 51/59 (86.4%); it has no same-run LLM-only arm. The judge threshold was chosen on this synthetic suite, so these are development results, not an independent holdout or a guarantee for real repositories. An expanded 125-label repository-style suite adds cross-file workflow, installable-package, and async event-bus traps. Its pure Skylos baseline is 71/125 (56.8%); no paid Jev/LLM result has been run on that expanded suite yet.
On a harder 19-label dynamic-dispatch challenge, Jev correctly routed all 11 used symbols to the LLM and skipped it for six unused symbols. The paired final score still tied at F1=0.727: both arms retained six false positives from a JSON-configured router. This is a measured limitation, not a claimed accuracy improvement.
Dead-code review is opt-in. A normal skylos . scan stays local and uses no model. skylos agent verify . uses the LLM verifier by default; choose Jev explicitly when you want it:
skylos agent verify . --format json # LLM only skylos agent verify . --dead-code-review jev --format json # Jev only skylos agent verify . --dead-code-review jev-llm --format json # Jev, then LLM if uncertain Jev-only needs TYPESAFE_API_KEY, not an LLM key. Confident Jev "unused" decisions retain a static finding and confident "used" decisions suppress it; uncertain or unavailable decisions leave the finding visible as unverified. Jev-plus-LLM also needs a configured LLM provider and sends uncertain decisions to the LLM. Jev alone never authorizes --fix. If you select either Jev mode without TYPESAFE_API_KEY, Skylos stops with setup instructions instead of silently switching review modes. Get a key by signing in at the official TypeSafe console (access may require an invitation), then set TYPESAFE_API_KEY in your environment; do not put it in source control or a command-line argument.
Jev sends a bounded project source snapshot to TypeSafe (currently at most 64 KB). Check it for embedded secrets and confirm sharing is authorized; the local file guard is not a secret scanner. Oversized or unsafe snapshots cannot be judged by Jev. The older --jev-judge and --jev-precheck flags remain available for compatibility; use --dead-code-review for new workflows. See the dead-code review guide for key setup, fallback behavior, and limitations.
liveness_primer, created and maintained by Matthew Digman, is Skylos's official real-project regression testing tool. On every PR, it compares the base and proposed merge result against the same pinned Python projects and reports which findings were added, removed, or changed.
Read the Analyzer Blast Radius check for the comparison and downloadable reports. These results complement the labeled benchmarks above; a change in finding counts alone does not establish accuracy. See the liveness_primer guide for scope, review steps, and reproduction commands.
Skylos-assisted dead-code cleanup PRs have been merged in Black, NetworkX, Optuna, mitmproxy, pypdf, beets, and Flagsmith. These are accepted cleanup PRs, not project endorsements. See Real-World Results.
A local Astronomer scan on April 26, 2026 computed 420 stargazers and returned overall trust: A. StarGuard also reported low fake-star risk.
Generate a GitHub Actions workflow from the CLI:
skylos cicd init --upload skylos cicd init --upload --scan-path apps/api The generated workflow reviews changed lines on pull requests and uploads full scans on pushes using GitHub OIDC. It supports monorepo subprojects through --scan-path.
To scan a built image with the composite Action, install a pinned Trivy version in the caller's job and set image to a trusted repository@sha256: build output plus image-platform. This runs an image-only scan; mode: gate uses image-fail-on (default high), while mode: scan only reports findings. See container-image scanning.
Does Skylos replace Bandit, Semgrep, CodeQL, or Vulture?
No. Skylos can run alongside them. It focuses on framework-aware dead-code signal, PR gating, AI-era regression checks, and a combined workflow across dead code, security, secrets, quality, and AI-defect checks.
No. Core static analysis runs locally without API keys. LLM features are optional through skylos[llm] and agent commands.
Without SKYLOS_API_KEY the MCP server only exposes analyze (dead code, 5 calls/day). Every other MCP tool (verify_change, verify_agent, security_scan, secrets_scan, and so on) returns an authentication error until the server is started with SKYLOS_API_KEY set; create a key in the Skylos Cloud dashboard settings. The CLI equivalents (skylos verify, skylos defend, skylos . -a) and skylos agent install-hooks run fully locally with no account or key.
No. skylos lint is an optional convenience entry point that delegates to Ruff. Install it with pip install "skylos[lint]"; normal Skylos scans do not run Ruff or merge Ruff violations into SKY-* findings.
Yes. Use skylos . -a --diff origin/main locally or configure CI gates to focus on new findings.
How should I handle intentional dynamic code?
Use baselines, whitelists, inline suppressions, or runtime tracing. See the configuration docs and smart tracing docs.
Skylos is licensed under the Apache License 2.0.
static-analysis dead-code unused-code unused-imports security linter code-quality sast python-sast vulnerability-scanner python-linter python-security python-security-scanner typescript-linter quality-gate ci-cd github-actions github-actions-security gitlab-ci gitlab-ci-security shell-security supply-chain-security code-review secrets-detection mcp mcp-server ai-agent ai-tool coding-agent vulture-alternative bandit-alternative semgrep-alternative code-scanner dead-code-detector devsecops vibe-coding ai-generated-code ai-code-security prompt-injection ai-supply-chain-security phantom-function hallucinated-dependency copilot-review
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Yanked reason: bug in 3.5.8 for skylos cicd init




