Skip to main content

SKY-A125 · AI-code defects

Scanner suppression marker added

Medium

Code-scanning platforms such as DeepSource, Checkov, Trivy, CodeQL and SonarQube read special comments that tell them to stop reporting a line, a resource or a file. SKY-A125 reports a change that adds one of these markers.

Languages
Any file with comments (Python, JavaScript/TypeScript, Go, Java, PHP, Ruby, C/C++, Terraform, YAML, shell, Dockerfiles and more)
Turned on by
skylos . --ai-defects --diff origin/main (or -a) on a change; also skylos done
Quality gate
counted toward the gate limits (full and diff scans). Counts toward max_ai_defects when the scan has a change to compare. skylos done lists it under guardrail_tampering, which advises by default.
Finding type
review
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

Why it matters

The marker hides a finding from a check that runs somewhere else, often in CI after the pull request is opened. A coding agent that cannot make that check pass can add one line, and the reviewer sees a comment rather than the weakness it hides.

What Skylos flags

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

app/settings_loader.py · Python · changed
import json  def load_settings(path):    try:        with open(path) as handle:            return json.load(handle)Removed:     except (OSError, ValueError):Added:     except Exception:  # skipcq: PYL-W0703        return {}

What Skylos leaves alone

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

app/settings_loader.py · Python · changed
import json  def load_settings(path):    try:        with open(path) as handle:            return json.load(handle)Removed:     except (OSError, ValueError):Added:     except Exception:  # nosemgrep        return {}

Why Skylos leaves it alone

In Python, JavaScript/TypeScript, Go, Rust, Java/Kotlin and C# files, nosemgrep and NOSONAR belong to SKY-A118, which skylos done reports. SKY-A125 leaves them alone there so the same comment is not reported twice.

More languages

HCL

Flagged

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

infra/storage.tf · HCL · changed
resource "aws_s3_bucket" "invoices" {  bucket = "acme-invoices"} resource "aws_s3_bucket_public_access_block" "invoices" {Added:   #checkov:skip=CKV_AWS_54:partner portal reads the bucket  bucket                  = aws_s3_bucket.invoices.id  block_public_acls       = trueRemoved:   block_public_policy     = trueAdded:   block_public_policy     = false  ignore_public_acls      = trueRemoved:   restrict_public_buckets = trueAdded:   restrict_public_buckets = false}

Not flagged

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

docs/infrastructure.md · Markdown · changed
# Infrastructure checks Checkov scans every Terraform change in CI.Added:  Added: Never add `#checkov:skip=CKV_AWS_54` to a bucket that holdsAdded: customer data; ask the platform team instead.

Why Skylos leaves it alone

Markdown, reStructuredText and plain-text files are not read: a marker there is being explained, not used.

How Skylos decides

  1. Runs with --ai-defects when there is a change to compare: in a diff scan (--diff or --diff-base), in a full scan of a Git checkout with uncommitted changes, and in skylos done. It compares each changed file at the base with the same file in the working tree.
  2. Reads files whose comment style it knows: # (Python, Ruby, shell, YAML, Terraform, Dockerfile), // and /* */ (C-family, Go, Java, JavaScript/TypeScript, Swift, Dart), PHP, -- (SQL, Lua) and HTML-style markup. Documentation files, test files, generated files and vendored folders are left out; markers in tests are only counted.
  3. Looks for markers inside comments only: DeepSource skipcq, JetBrains/Qodana noinspection, Qlty qlty-ignore, CodeScene @codescene(disable...), CodeQL codeql[...] and lgtm[...], Checkov checkov:skip=, Trivy trivy:ignore: (and tfsec:ignore:) and KICS kics-scan ignore. NOSONAR and nosemgrep count only in languages SKY-A118 does not read, such as PHP, Ruby, Terraform and YAML.
  4. Reports a marker only on a line the change added, and only when the file now holds more of that marker than at the base, so moved or reindented lines are not new.
  5. The message names the tool, what it stops reporting (this line, the next line, the resource block, the whole file), the rule IDs and the reason, or says that none was given. At most 20 markers are listed.

How to fix it

Fix what the platform reported. Here, catch only the errors a bad settings file can raise. If a marker really is right, keep it as narrow as the tool allows, write the reason after it and let a reviewer confirm it.

app/settings_loader.py · Python · the fix, against the flagged file
import json  def load_settings(path):    try:        with open(path) as handle:            return json.load(handle)Removed:     except Exception:  # skipcq: PYL-W0703Added:     except (OSError, ValueError):        return {}

When it can be wrong

  • A deliberate, reviewed marker is still reported, with its reason quoted. That is intended: the reviewer decides.
  • A file whose name or folder does not look like a test is treated as code, so a marker in a test helper under another folder is reported.
  • Snyk Code's deepcode ignore and Codacy have no marker the rule reads, so those are not reported.

Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.

How to silence it

  • An inline # skylos: ignore[SKY-A125] on the reported line does not silence it in Skylos 5.6.0: this rule reports a path relative to the project, and the inline-ignore lookup does not match it. Use the setting below.

    Python
    except Exception:  # skipcq: PYL-W0703  # skylos: ignore[SKY-A125] fallback
  • [tool.skylos] ignore = ["SKY-A125"] turns the rule off for the project. For skylos done, set guardrail_tampering = "off" under [tool.skylos.done.checks] in the base branch.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.