Logo di Python Packaging Static Audit

Python Packaging Static Audit

Organizzazione
opendatahub-io
python-packaging-static-audit

Run hexora static analysis on a Python package repository to detect suspicious code patterns, then triage findings with deterministic rules and AI reasoning to produce a structured risk report section.

Panoramica

Autoreopendatahub-io
Repositoryai-helpers
Nome della skillpython-packaging-static-audit
Stelle
39
Fork
76
File inclusi
2
LicenzaApache-2.0
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • 2 file inclusi

    Script, modelli di documento e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da opendatahub-io su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Python Packaging Static Audit in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-python-packaging/skills/python-packaging-static-audit
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/opendatahub-io/ai-helpers.git /tmp/ai-helpers
mkdir -p .claude/skills
cp -r /tmp/ai-helpers/plugins/odh-python-packaging/skills/python-packaging-static-audit .claude/skills/python-packaging-static-audit
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Python Packaging Static Audit in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Python Packaging Static Audit non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Python Packaging Static Audit non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Python Packaging Static Audit

Runs hexora static analysis on a Python package repository to detect suspicious code patterns such as code execution, encoding/serialization, and native code usage. Produces a self-contained "Hexora Static Analysis" report section with triaged findings and a risk assessment.

Inputs

  • repo_path (required): Local filesystem path to an already-cloned repository
  • output_file (optional): Write the report section to this file path instead of returning it inline. The first line of the file must be RISK_RATING:<value> so the orchestrator can parse it without reading the full report.
  • hexora_results (optional): File path to pre-computed hexora JSON output (hexora-results.json). Schema: {status, total, findings[]}. When provided, skip running run-hexora.sh and parse this file directly for triage. Status values: "success", "unavailable", "timeout", "error".

Step 1: Obtain Hexora Results

Option A - Pre-computed results (CI mode)

If hexora_results is provided and the file exists, read and parse it as JSON:

  • If status is "success": use the findings array as the hexora output. Each entry is a raw hexora JSONL object (rule, severity, file, line, etc.). Rules HX1000, HX1020, HX1030, HX3010, HX3040, HX5000-HX5050, HX6020-HX6060, HX7000-HX7020 are already excluded by the CI runner; minimum confidence is medium. Proceed directly to Step 2 (Triage).
  • If status is "unavailable", "timeout", or "error": skip to the Output section and produce the report with risk_rating = needs_review, noting the degraded status and any error message from the JSON. Do not re-run hexora. The CI runner already attempted execution under controlled conditions, and re-running in the agent container would likely hit the same failure.
  • For any other status value not listed above: treat it as an error and report risk_rating = needs_review, noting the unrecognized status value.

Option B - Run hexora locally (standalone mode)

If hexora_results is not provided, run the wrapper script which handles hexora installation and applies the tuned rule exclusions:

bash
./scripts/run-hexora.sh <repo-path>
hexora_exit=$?

Check the exit code before proceeding:

  • Exit 0: hexora ran successfully. Capture the JSON output. Each finding contains: rule code, file path, line number, confidence level, and description.
  • Exit 2: hexora is not installed and cannot be auto-installed via uvx. Do not fail. Skip to the Output section and produce the report with risk_rating = needs_review stating hexora was unavailable.
  • Exit 1: hexora encountered a runtime error. Skip to the Output section and produce the report with risk_rating = needs_review noting the error.

The wrapper filters out rules that are too noisy for typical Python packages and sets a minimum confidence of medium. See the script comments for the full exclusion list and rationale.

Step 2: Triage

Review hexora findings in context. Read the relevant source files to understand the purpose of flagged code. Triage proceeds in two stages: deterministic rules first, then AI reasoning for anything unresolved.

Stage 1 — Deterministic Rules

Apply the following rules before any AI reasoning. These handle the most common clear-cut cases and make the triage reproducible.

ConditionVerdict
Finding is in a file under test/, tests/, benchmarks/, or examples/PASS
Finding references a standard-library import already excluded by run-hexora.sh rule setPASS
Finding is in setup.py, setup.cfg, or pyproject.toml and involves eval, exec, compile, base64, or marshalREVIEW

When multiple findings produce different verdicts, the overall precedence is BLOCK > REVIEW > PASS — the most severe verdict wins.

Any finding not resolved by Stage 1 proceeds to Stage 2.

Stage 2 — AI Reasoning

For findings that remain unresolved after deterministic rules, classify each as:

  • Likely legitimate — pattern is expected for the package's purpose (e.g., subprocess in a CLI tool)
  • Suspicious — pattern is unusual and warrants manual review (e.g., base64 decode in setup.py)
  • Critical — pattern strongly indicates malicious intent (e.g., network exfiltration in install hooks)

Output Format

Produce the following markdown section:

markdown
## Hexora Static Analysis

**Findings:** {N total} ({X critical, Y suspicious, Z likely legitimate})

### Critical Findings

| File | Line | Rule | Confidence | Description | Triage |
|------|------|------|------------|-------------|--------|
| setup.py | 42 | HX2000 | Very High | Base64 decode in install hook | Suspicious — no legitimate reason for encoded payloads in setup.py |

### Suspicious Findings

(same table format)

### Likely Legitimate

(same table format, brief — included for completeness but de-emphasized)

The risk_rating for this phase is one of:

  • no_issues — No hexora findings
  • low_risk — All findings classified as "likely legitimate" or PASS
  • needs_review — One or more findings classified as "suspicious" or REVIEW
  • critical — One or more findings classified as "critical" or BLOCK

If output_file is provided, write the file with the first line as RISK_RATING:<value> followed by a blank line and then the markdown section above. If output_file is not provided, return the report section inline.

Error Handling

ScenarioBehavior
Hexora returns empty resultsReport "no findings" for hexora section, risk_rating = no_issues
Hexora is unavailable (uvx and hexora both missing)Report hexora unavailable, risk_rating = needs_review
Pre-computed hexora_results file path provided but file missing, unreadable, or invalid JSONReport hexora unavailable, risk_rating = needs_review
Pre-computed hexora_results has degraded status (unavailable/timeout/error)Do not re-run hexora; report the degraded status, risk_rating = needs_review

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Python Packaging Static Audit?

Run hexora static analysis on a Python package repository to detect suspicious code patterns, then triage findings with deterministic rules and AI reasoning to produce a structured risk report section.

Perché usare Python Packaging Static Audit su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Python Packaging Static Audit è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Python Packaging Static Audit in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-python-packaging/skills/python-packaging-static-audit. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Python Packaging Static Audit?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Python Packaging Static Audit?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Python Packaging Static Audit: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Python Packaging Static Audit è gratuita?

Sì. È pubblicata su GitHub da opendatahub-io con licenza Apache-2.0. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇