← 返回 Skills 市场
Prompt Safe
作者
alexunitario-sketch
· GitHub ↗
· v1.0.4
2236
总下载
4
收藏
10
当前安装
5
版本数
在 OpenClaw 中安装
/install prompt-assemble
功能描述
Token-safe prompt assembly with memory orchestration. Use for any agent that needs to construct LLM prompts with memory retrieval. Guarantees no API failure due to token overflow. Implements two-phase context construction, memory safety valve, and hard limits on memory injection.
安全使用建议
What to check before installing or using this skill:
1) Audit the code before copying it into any agent. The provided script appears truncated in the packaged file (ends with 'return ful…'), which will cause runtime errors and could be a sign of accidental corruption or tampering. Ensure the build() method returns the assembled prompt (e.g., the full_text or assembled string) and run unit tests with representative inputs.
2) Manually inspect SKILL.md for any phrases that try to change system-level prompts or inject instructions beyond assembling prompts. The scanner flagged a 'system-prompt-override' pattern — this may be a false positive, but verify that no text attempts to override or stealthily alter the agent’s system prompt or control flow.
3) Review memory storage policy for privacy implications. The skill explicitly recommends storing PII-like items (name, timezone, preferences). If you will persist memory, ensure your memory backend enforces encryption, access control, and retention/erasure policies appropriate for PII.
4) Resolve inconsistencies in token-safety settings. The SKILL.md and references disagree on recommended safety margins (0.75 vs 0.85), and the token-estimation heuristics are approximate. Decide on a single safety margin for your deployment and, if your application runs near model limits, prefer an exact BPE estimator (tiktoken or equivalent).
5) Test in a sandbox with mocked get_recent_dialog_fn and memory_search_fn to confirm behavior: ensure no unexpected network calls, no logging of sensitive content to external endpoints, and that the safety valve behaves as documented (skips memory but preserves system prompt and user input).
6) If you lack the ability to audit Python code yourself, don't deploy this into agents that handle sensitive data until a trusted reviewer has validated the implementation and fixed the truncated/broken return. After fixes, re-run static analysis and unit tests.
If you want, I can: (a) point out the exact lines in the Python file that look broken and propose a patch to fix the truncated return, (b) search the SKILL.md text for phrases that could be misused to attempt system-prompt changes, or (c) produce a minimal test harness to validate behavior safely.
功能分析
Type: OpenClaw Skill
Name: prompt-assemble
Version: 1.0.4
The OpenClaw AgentSkills bundle 'prompt-assemble' is a utility designed for token-safe prompt assembly and memory orchestration for LLM agents. The `SKILL.md` instructions clearly define the skill's purpose and workflow, without any evidence of prompt injection attempts or malicious instructions for the agent. The core implementation in `scripts/prompt_assemble.py` is well-structured, uses local token estimation heuristics, and relies on functions passed as arguments for memory and dialog retrieval, without making any suspicious external network calls, accessing sensitive files, or executing arbitrary code. All components align with the stated goal of preventing token overflow and ensuring API stability, indicating a benign and well-engineered utility.
能力评估
Purpose & Capability
Name, description, SKILL.md and the included Python implementation all describe the same functionality (two-phase prompt assembly, memory retrieval, token safety). The skill does not request unrelated binaries, environment variables, or config paths — the declared requirements are proportionate to the stated purpose.
Instruction Scope
Instructions are narrowly focused on assembling prompts and memory handling. They do instruct you to copy the provided script into your agent and call its build() API, which is expected. Two points to review: (1) a pre-scan flag indicates 'system-prompt-override' patterns in SKILL.md — while the doc mostly says 'Never downgrade system prompt', the scanner flagged content that could be used for prompt injection strategies and should be manually inspected, and (2) the memory policy explicitly recommends storing user identity, timezone, and similar PII; that is legitimate for memory systems but raises privacy considerations and should be constrained to your data-retention rules.
Install Mechanism
There is no install spec and no downloads; the skill is instruction-only plus a Python file. That is low-risk from an install perspective because nothing external is pulled in at install time. The code would be copied into the agent's codebase when used, so standard code-audit precautions apply.
Credentials
The skill requests no environment variables or credentials. Its memory guidelines permit storing personal data (name, timezone, preferences), which is functionally reasonable for a memory system but requires you to ensure appropriate access controls and retention policies; nothing in the skill asks for unrelated secrets or cloud credentials.
Persistence & Privilege
always is false and the skill does not demand persistent platform privileges. It suggests copying code into your agent (normal). It does not attempt to modify other skills or system-wide settings in the provided materials.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install prompt-assemble - 安装完成后,直接呼叫该 Skill 的名称或使用
/prompt-assemble触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.4
Renamed to 'Prompt Safe'. Added compelling description emphasizing token overflow prevention and API stability.
v1.0.3
Unified defaults: max_tokens=204000, safety_margin=0.75 in both PromptAssembler class and build_prompt() function.
v1.0.2
Reduced safety margin to 75% for conservative design. Leaves 25% buffer for model overhead and edge cases.
v1.0.1
Updated default context window to 204000 (MiniMax-M2.1). Added model reference table in documentation.
v1.0.0
prompt-assemble 1.0.0
- Initial release of a token-safe prompt assembly framework for LLM agents with memory retrieval.
- Implements two-phase context construction and a memory safety valve to prevent token overflow.
- Guarantees stability by enforcing hard limits on injected memory and centralizing token budget decisions.
- Provides clear rules: memory is optional and discardable, while system prompts and user inputs remain intact.
- Includes a ready-to-use Python module (`prompt_assemble.py`) and comprehensive documentation for integration.
元数据
常见问题
Prompt Safe 是什么?
Token-safe prompt assembly with memory orchestration. Use for any agent that needs to construct LLM prompts with memory retrieval. Guarantees no API failure due to token overflow. Implements two-phase context construction, memory safety valve, and hard limits on memory injection. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 2236 次。
如何安装 Prompt Safe?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install prompt-assemble」即可一键安装,无需额外配置。
Prompt Safe 是免费的吗?
是的,Prompt Safe 完全免费(开源免费),可自由下载、安装和使用。
Prompt Safe 支持哪些平台?
Prompt Safe 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Prompt Safe?
由 alexunitario-sketch(@alexunitario-sketch)开发并维护,当前版本 v1.0.4。
推荐 Skills