Skip to main content

C-GULL

Code Guardian for Unchecked Logic & Leaks — static security analysis for C codebases.

Python Version License Security Standards Tests

C-GULL is a Python-based static analyzer focused on security, memory safety, correctness, and defensive C development. It combines lightweight pattern analysis with structural parsing, control/data-flow analysis, and interprocedural facts, while remaining usable as a simple command-line utility.

It is designed for incremental adoption: run it with useful defaults on an existing source tree, then add project-specific include paths, wrappers, trust-boundary models, baselines, and CI policy as needed.

Why C-GULL

  • Security-oriented C analysis — memory lifetime, unsafe APIs, bounds/arithmetic, format strings, command injection, trust boundaries, sensitive data, and selected compliance/correctness checks.
  • Hybrid analysis — regex, AST/structural, CFG/data-flow, and interprocedural analysis are used where appropriate.
  • Build-aware operation — translation-unit mode, include resolution, compile-command ingestion, and conditional-configuration exploration support real C projects.
  • Project semantics — model custom allocators, deallocators, banned wrappers, sources, validators, sinks, and call effects without hardcoding project names into rules.
  • CI-ready reporting — terminal, JSON, Markdown, and SARIF output; severity gates, analysis-error/fallback gates, and baseline/diff adoption.
  • Conservative automation — findings distinguish mechanically safe fixes from suggested fixes and manual review.

Install

C-GULL requires Python 3.10+.

python -m pip install cgull

Install optional AST/preprocessing support for the strongest structural analysis:

python -m pip install "cgull[ast]"

Get started

From the root of a C project:

cgull scan .

That is the intended default workflow. C-GULL recursively discovers supported source/header files, uses the hybrid engine, reports all severities, runs sequentially, and writes a terminal report.

Scan a narrower target when needed:

cgull scan src/
cgull scan src/main.c include/project.h

List the installed rule catalog:

cgull rules

Create a starter ignore file:

cgull init-ignore

Add project policy

C-GULL automatically discovers .cgull.toml, or [tool.cgull] in pyproject.toml, by searching upward from the scan target. For example:

schema_version = 1

[paths]
exclude = ["third_party/", "build/"]

[output]
fail_on = "high"

The everyday command remains:

cgull scan .

Project include roots can be kept in .cgullincludes, while .cgullignore defines files/directories outside the scan boundary. See the documentation links below for their exact resolution and precedence behavior.

Common workflows

Generate machine-readable reports:

cgull scan . --format json -o cgull.json
cgull scan . --format sarif -o cgull.sarif

Gate high-severity findings in CI:

cgull scan . --fail-on high

Adopt C-GULL on a codebase with existing findings:

cgull scan . --update-baseline .cgull-baseline.json
cgull scan . --baseline .cgull-baseline.json --fail-on high

Use translation-unit/build context:

cgull scan . --mode tu --compile-commands build/compile_commands.json

Preview or apply mechanically safe fixes:

cgull scan . --fix
cgull scan . --fix --write

Documentation

The documentation knowledgebase contains the detailed user and maintainer guides. Start with:

For changes between releases, see the changelog. GitHub Releases contain release-specific summaries and generated pull-request lists. Maintainers should follow the release guide; contributors should also read CONTRIBUTING.md.

Project status

C-GULL is under active development. Static analysis is necessarily conservative and no analyzer proves that C code is secure. Treat findings as engineering evidence: review them in source/build context, tune project semantics deliberately, and combine static analysis with compiler diagnostics, testing, sanitizers, fuzzing, review, and platform-specific security controls.

License

C-GULL is licensed under the Apache License 2.0.

Metadata

Release files for cgull 0.11.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cgull 0.11.7
File Size Uploaded
cgull-0.11.7.tar.gz 493.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cgull 0.11.7
File Interpreter ABI Platform
cgull-0.11.7-py3-none-any.whl Python 3 none any Details

Total release size: 880.5 kB

Release files / cgull-0.11.7.tar.gz

Download URL cgull-0.11.7.tar.gz
Size 493.6 kB
Tags Source
SHA-256 checksum
How to use checksums
aa7ef451107923d1806ef34f2bc9c99e5ecebc9ffa05930b003de42c6f29f32c
BLAKE2b-256 checksum
How to use checksums
72ec33253a9e571d752e92d50d5ec4e0785ce259df96c14fc2445b8d64e4994a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 9, 2026.

Transparency log

Release files / cgull-0.11.7-py3-none-any.whl

Download URL cgull-0.11.7-py3-none-any.whl
Size 386.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ced0ab3aa7590920190ee877ce28f19edca350c5b33610ee751ed60eca46aa3
BLAKE2b-256 checksum
How to use checksums
8b2bec0ef7c8bcf0fcabdab0aa7365d95e30b74f2b2de28ab40c0b2957845b80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.11.7 This release

2 release files

0.9.8

2 release files

0.8.28

2 release files

0.6.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page