Skip to content

Feature Request: Append Additional System Instructions via Environment Variable #15848

@Himaa-Dev

Description

@Himaa-Dev

What would you like to be added?

Summary
Currently, Gemini CLI supports replacing the default system instructions using the GEMINI_SYSTEM_MD environment variable. While this is useful, it makes it difficult to extend or reinforce system behavior without losing the default instructions provided by the CLI.
This issue proposes an additive (append-only) mechanism for advanced workflows.

Why is this needed?

Problem
When using GEMINI_SYSTEM_MD, the default system instructions are fully replaced.
This can unintentionally remove important built-in guidance related to safety, CLI behavior, or general best practices.
For agent-based or long-running workflows (e.g. memory prompts, strict execution contracts, or behavior enforcement), users often want to extend the system instructions rather than replace them entirely.

Additional context

Proposed Solution
Introduce a new optional environment variable:

GEMINI_SYSTEM_MD_ADD
(or GEMINI_SYSTEM_MD_APPEND if preferred)
Behavior:
The existing system instructions (from GEMINI.md or GEMINI_SYSTEM_MD) remain unchanged.
If GEMINI_SYSTEM_MD_ADD is set, its contents are appended to the final system instructions.
The append operation is strictly additive (no override, no replacement).
Conceptually:

Final System Instructions =
Base System Instructions
+
Additional Instructions (append-only)
Key Properties
✅ Backward-compatible
✅ No change to default behavior if the variable is unset
✅ Append-only (no override or prepend)
✅ Preserves all existing safety and system guidance
Why this is useful
Enables advanced agent workflows
Allows reinforcing behavioral or memory-related rules
Avoids duplicating or reimplementing default system instructions
Keeps the CLI flexible without increasing risk

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions