帮助开发者读取、编写并调试 Pysa 的 JSON 污点模型与 .models 输出
该技能材料显示其本质是用于解释/编写 Pysa JSON 模型语法的提示型开源技能,不要求密钥、未声明远程端点,也未显示执行代码或访问本地数据的能力。基于现有材料整体风险较低,主要需留意的是社区采用度和维护状态信息不足。
材料明确标注无需密钥或环境变量,未见 token、API key 或凭证配置要求,凭证泄露与滥用面较小。
未声明任何远程端点,且系统检查项为 prompt-only;从材料看仅描述 Pysa JSON/NDJSON 语法,不涉及将用户数据发送到外部服务。
现有描述表现为文档/提示型技能,用于读取、编写或调试 .models 输出格式;未见本机起进程、执行脚本或调用系统能力的说明。
材料未声明可读写文件、目录或其他资源;虽提到处理 .models 文件,但从给定信息看更像语法说明而非实际文件访问工具,未见过度授权迹象。
来源指向 GitHub 上的开源仓库 facebook/pyre-check,源码可审计,这明显降低风险;但许可证未声明、社区采用显示为 0 star、维护状态未知,供应链透明度与持续维护信息仍不足,建议安装前复核仓库对应关系与最近提交情况。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "pysa-json-models" 技能: 1. 下载 https://raw.githubusercontent.com/facebook/pyre-check/main/.llms/skills/pysa-json-models/SKILL.md 2. 保存为 ~/.claude/skills/pysa-json-models/SKILL.md 3. 装好后重载技能,告诉我可以用了
请解释这段 Pysa JSON model 的结构与字段含义,重点说明 sources、sinks、tito、sanitizers 和 issues 各自表示什么,并指出可能的格式错误:
{...粘贴 JSON 内容...}一份对 JSON 字段的逐项说明,以及潜在语法或建模问题的诊断建议。
根据这个 Python 函数签名和行为,为 Pysa 生成 JSON taint model:参数 user_input 是 source,参数 query 会流向 sink,返回值保留 TITO;请输出合法的 .models JSON 片段并附简要说明。 函数签名:def run_query(user_input: str, query: str) -> str
一个可用于 .models 文件的合法 JSON 模型片段,并说明 source、sink 与 TITO 的映射关系。
我在 Pysa 的 .models 输出里看到了这条 issue,但不确定为什么会触发。请结合模型内容分析污点传播路径、可能的误报原因,并给出修改模型或代码的建议:
{...粘贴 issue JSON 与相关 model JSON...}对 issue 触发原因的解释、传播路径分析,以及减少误报或修复问题的具体建议。
Pysa outputs analysis results as newline-delimited JSON (NDJSON). Each line is a self-contained JSON object with "kind" and "data" fields. There are two kinds: "model" (a callable's taint behavior) and "issue" (a detected vulnerability).
Every JSON object is wrapped as:
{"kind": "model", "data": { ... }}
{"kind": "issue", "data": { ... }}
Models and issues are separate top-level objects. Issues are never nested inside models.
{
"callable": "module.function_name",
"filename": "module.py",
"callable_line": 42,
"sources": [ ... ],
"sinks": [ ... ],
"tito": [ ... ],
"parameter_sources": [ ... ],
"global_sanitizer": { ... },
"parameters_sanitizer": { ... },
"sanitizers": [ ... ],
"modes": [ "Obscure", ... ]
}
All fields except callable are optional. Empty fields are omitted entirely — never include empty arrays [] or objects {}.
Note: "sources" represents generations (taint produced by the function). This is distinct from "parameter_sources" which represents sources on parameters.
"module.function_name""module.ClassName.method_name""Obj{module.ClassName.attribute_name}"Available modes: Obscure, SkipObscure, SkipAnalysis, SkipOverrides, AnalyzeAllOverrides, Entrypoint, IgnoreDecorator, SkipModelBroadening, InferSelfTito, InferArgumentTito.
Each of sources, sinks, tito, and parameter_sources is a list of port entries:
{
"port": "<port>",
"taint": [ <trace_element>, ... ]
}
| Port | Meaning |
|---|---|
result | Return value |
result[field] | Return value with access path |
formal(name, position=N) | Named parameter at position N |
formal(name, position=N, positional_only) | Positional-only parameter |
formal(name, position=N)[field][subfield] | Parameter with access path |
formal(*args, position=N) | Variadic positional args |
formal(**kwargs) | Variadic keyword args |
formal(**kwargs, excluded=[x]) | Kwargs excluding named params |
formal($global, position=0) | Global/attribute model port |
Key rule: position is always included in formal() ports (e.g., formal(x, position=0), not formal(x)).
For sources/parameter_sources, the port indicates where taint is produced (typically result or result[field]).
For sinks, the port indicates where taint is consumed (typically formal(...) with optional access path).
For tito, the port indicates the input side (always formal(...)). The output side is encoded inside the taint entry via return_paths.
Each element in a "taint" list is a trace element keyed by its call info. There are four call info variants:
{
"kinds": [ { "kind": "Test" } ],
"declaration": null
}
This is the leaf of the trace — the taint is directly declared by the user, not propagated from another function.
{
"kinds": [ { "kind": "Test", "length": 0 } ],
"origin": { "line": 16, "start": 15, "end": 20 }
}
Represents a call to a function with a user-declared model. The origin location is where the call happens. "call_site" may also be present (e.g., "call_site": "16:4-16:21").
{
"kinds": [ { "kind": "Test", "length": 2 } ],
"call": {
"position": { "line": 20, "start": 8, "end": 22 },
"resolves_to": [ "module.callee_function" ],
"port": "result[a]"
}
}
…
用于运行、调试与更新 Pysa 污点分析端到端集成测试及期望结果
帮助你快速理解 Pyre/Pysa 代码架构并定位关键实现位置
帮助开发者在提交代码或生成 diff 时套用正确的提交前缀、审阅人和测试计划。
帮助开发者排查 Pysa 漏报污点问题,比较输出并定位污点流丢失位置。
帮助开发者提取并核对 React 错误信息与错误码映射,排查未知错误码警告。
帮助开发者排查功能开关相关测试失败、更新标记并新增 React flags。
可对 Python 代码做静态污点分析,追踪数据流并发现安全漏洞。
通过自然语言创建、分析并优化 PyPSA 能源系统模型
基于代码仓库梳理威胁边界、攻击路径与缓解措施,生成精炼威胁模型。
自动扫描依赖与代码漏洞并生成详细安全报告
以追加日志追踪已部署模型及其依赖,支持模型盘点与治理审计。
扫描代码中的 TODO、FIXME 与 XXX 标记,并输出可排序的问题清单。