Zum Inhalt springen
machichdigital

OpenAI & ChatGPT · Foto: Kevin Rheese, CC BY 2.0

PromptPrompt-BibliothekLizenz: CC0-1.0 (Public Domain)frei kopierbar

Update Agent Permissions

Zuletzt aktualisiert:

⬇ Als Datei laden

⧉ –× kopiert⬇ –× heruntergeladenBewertung:

Typ

Prompt

Lizenz

CC0-1.0 (Public Domain)

Anwendungsfeld

Prompt-Bibliothek

Voraussetzungen

Keine besonderen — direkt loslegen.

Leitet aus der Chat-Historie granulare, nur lesende Berechtigungen für Claude Code und Gemini CLI ab.

Der Prompt

# Task: Update Agent Permissions

Please analyse our entire conversation and identify all specific commands used.

Update permissions for both Claude Code and Gemini CLI.

## Reference Files

- Claude: ~/.claude/settings.json
- Gemini policy: ~/.gemini/policies/tool-permissions.toml
- Gemini settings: ~/.gemini/settings.json
- Gemini trusted folders: ~/.gemini/trustedFolders.json

## Instructions

1. Audit: Compare the identified commands against the current allowed commands in both config files.
2. Filter: Only include commands that provide read-only access to resources.
3. Restrict: Explicitly exclude any commands capable of modifying, deleting, or destroying data.
4. Update: Add only the missing read-only commands to both config files.
5. Constraint: Do not use wildcards. Each command must be listed individually for granular security.

Show me the list of commands under two categories: Read-Only, and Write

We are mostly interested in the read-only commands here that fall under the categories: Read, Get, Describe, View, or similar.

Once I have approved the list, update both config files.

## Claude Format

File: ~/.claude/settings.json

Claude uses a JSON permissions object with allow, deny, and ask arrays.

Allow format: `Bash(command subcommand:*)`

Insert new commands in alphabetical order within the allow array.

## Gemini Format

File: ~/.gemini/policies/tool-permissions.toml

Gemini uses a TOML policy engine with rules at different priority levels.

Rule types and priorities:
- `decision = "deny"` at `priority = 200` for destructive operations
- `decision = "ask_user"` at `priority = 150` for write operations needing confirmation
- `decision = "allow"` at `priority = 100` for read-only operations

For allow rules, use `commandPrefix` (provides word-boundary matching).
For deny and ask rules, use `commandRegex` (catches flag variants).

New read-only commands should be added to the appropriate existing `[[rule]]` block by category, or a new block if no category fits.

Example allow rule:
```toml
[[rule]]
toolName = "run_shell_command"
commandPrefix = ["command subcommand1", "command subcommand2"]
decision = "allow"
priority = 100

Gemini Directories

If any new directories outside the workspace were accessed, add them to:

  • context.includeDirectories in ~/.gemini/settings.json
  • ~/.gemini/trustedFolders.json with value "TRUST_FOLDER"

Exceptions

Do not suggest adding the following commands:

  • git branch: The -D flag will delete branches
  • git pull: Incase a merge is actioned
  • git checkout: Changing branches can interrupt work
  • ajira issue create: To prevent excessive creation of new issues
  • find: The -delete and -exec flags are destructive (use fd instead)

## Variablen & Platzhalter

Vor dem Einsatz diese Stellen durch eigene Angaben ersetzen:

- `rule`

## So nutzt du es

Den Prompt-Text kopieren (Button oben) und als System-Prompt bzw. erste Nachricht in ChatGPT, Claude oder einem lokalen Modell einfügen. In ChatGPT lässt er sich unter „Anweisungen für ChatGPT" dauerhaft hinterlegen.

Der Prompt-Text ist englisch — er funktioniert trotzdem in deutschen Unterhaltungen. Für deutsche Antworten einfach am Ende ergänzen: „Antworte auf Deutsch."


## Im Detail

Der Prompt lässt ein KI-Modell die eigene Chat-Historie durchsuchen, alle tatsächlich verwendeten Befehle extrahieren und daraus gezielte, nur lesende Freigaben für die Konfigurationsdateien von Claude Code und Gemini CLI ableiten. Der Nutzen: Statt pauschal mit Wildcards (z. B. "git *") zu arbeiten, was ein Sicherheitsrisiko darstellt, entsteht eine granulare Liste einzelner, ungefährlicher Befehle. Das reduziert die Angriffsfläche, falls ein Agent kompromittiert wird oder fehlerhaft handelt. Sinnvoll für alle, die KI-Coding-Agents nach dem Prinzip der geringsten Rechte betreiben wollen. Wichtig: Der Prompt schlägt nur vor, er ändert nichts automatisch – die Liste sollte vor dem Eintragen manuell geprüft werden, da die KI riskante Befehle falsch einordnen kann.

## Praxis-Tipp

Lassen Sie sich jeden vorgeschlagenen Befehl einzeln begründen ("warum ist genau dieser Befehl read-only?"), bevor Sie ihn in settings.json übernehmen.

## Siehe auch

- [Analyze code scanning security issues and dependency updates if vulnerable](/ki-verzeichnis/openai-chatgpt/analyze-code-scanning-security-issues-and-dependency-updates-if-vulnerable/)

## Lizenz & Quelle

- **Lizenz:** CC0-1.0 (Public Domain)
- **Quelle:** [awesome-chatgpt-prompts (GitHub)](https://github.com/f/awesome-chatgpt-prompts)

So einfach geht’s

  1. 01

    Anrufen oder schreiben

    Anruf, WhatsApp oder Formular. Die Ersteinschätzung am Telefon ist kostenlos.

  2. 02

    Termin oder Fernhilfe

    Ich komme zu Ihnen oder helfe per Fernhilfe am Bildschirm. Den Kostenrahmen erfahren Sie, bevor ich anfange.

  3. 03

    Erledigt, bezahlt wird danach

    Es läuft, und Sie wissen, wie es geht. Bei telefonisch vereinbarten Terminen zahlen Sie nach dem Termin bar, mit Karte oder auf Rechnung.

Inhalt ansehen (update-agent-permissions.txt)
Lade …

Erfahrungen & Kommentare.

Funktioniert der Prompt bei Ihnen? Tipps, Stolperfallen, Varianten — teilen Sie es mit der Community.

Lade Kommentare …

Ihre IP-Adresse wird zum Schutz vor Missbrauch gespeichert und nach 14 Tagen automatisch entfernt (Datenschutz).

Passt dazu.

aa/cli taste

Legt feste Tech- und Stilvorgaben für CLI-Projekte fest (pnpm, TypeScript, Commander.js, klare Ordnerstruktur).

CC0-1.0 (Public Domain)♥ –⧉ –