返回提示词目录第 1419 页

规划代码仓库的智能编程代理文件访问规则

检查仓库文件并区分敏感内容与低价值上下文,制定忽略及访问限制规则,同时说明保护边界与后续处置事项。

完整提示词

<context>
There are two reasons to keep files from an agent, and they need different tools. Privacy: secrets, keys, customer data exports and anything under contract must not be read or sent to a model provider. Context quality: generated code, minified bundles, lockfiles, snapshots, vendored dependencies and large fixtures waste tokens and pollute search, so the agent copies patterns from code nobody writes by hand. Ignore files in agent tools usually only control indexing and automatic context; an agent with a shell can still print the file. So ignore files help context quality but are not a security boundary: for secrets, the real protections are keeping them out of the working tree, permission deny rules for read tools and shell, and a sandbox. Hiding too much hurts too: the agent may need generated types, migration history or the lockfile to answer correctly.
</context>

<task>
Decide what to exclude for this repository:
<tree>
{{tree}}
</tree>
{{#tools}}Tools in use: {{tools}}{{/tools}}

1. If you can read the repository, list its top-level folders, large files and files matching sensitive patterns (environment files, keys, certificates, credential files, database dumps, exports). Do not open files that look like secrets; identify them by name.
2. Classify each candidate: block for privacy, exclude for context quality, keep readable but do not index, or keep. Give the reason, and note files the agent needs despite being generated (for example types it must import).
3. Write the rules: an ignore file in the format the tools use, and permission deny rules for read and shell access to the privacy-class paths. Mark syntax you are not sure of "check against the tool's documentation".
4. State plainly what these rules do not stop, for each tool: shell commands, subprocesses, tests that load the files, other agents or extensions.
5. List follow-ups: secrets that are committed or in the working tree should be moved out and rotated; data exports should leave the repository.
</task>

<constraints>
- Never print the contents of a secret or data file; refer to it by path only.
- Do not describe an ignore file as protecting secrets.
- Do not exclude files the agent needs for correct work without saying what it loses.
{{> output/uncertainty}}
</constraints>

<output_format>
## Classification
Table: path or pattern, class (privacy, context, read-not-index, keep), reason.
## Rules
Fenced blocks per file, each with its path.
## What this does not protect
Bullets per tool or access path.
## Follow-ups
Numbered actions such as moving and rotating secrets.
</output_format>

可替换内容

  • {{tree}}
  • {{#tools}}
  • {{tools}}
  • {{/tools}}
  • {{> output/uncertainty}}

分类与标签

编程开发、编程代理、仓库文件管理、敏感信息保护

前往 AI 图片创作