gitaiflow / Architecture / gitaiflow — Security and Privacy
DocsgitaiflowArchitecturegitaiflow — Security and Privacy

gitaiflow — Security and Privacy

gitaiflow is designed around a local-first execution model. Git discovery, diff generation, filtering, artifact creation, usage accounting, and provider configuration happen locally. The main exter...

5 min readApplies to v1.1.3
On this page ▾
  1. Security and Privacy Architecture
  2. Data Flow
  3. 1. Local Git Data
  4. 2. Diff Filtering and Redaction
  5. 3. AI Provider Boundary
  6. Credentials
  7. Local Artifacts
  8. Local Usage Log
  9. Telemetry
  10. Consent Persistence
  11. Privacy Boundary
  12. Security Recommendations

Security and Privacy Architecture

Data Flow

1. Local Git Data

gitaiflow reads the selected repository and obtains:

  • changed files
  • diff content
  • repository name
  • current branch
  • resolved base reference
  • Git author
  • change timestamps
  • file status

These values are collected locally.

2. Diff Filtering and Redaction

Before a normal AI request, the generated diff is filtered.

The implementation excludes sensitive/environmental material including:

text
.env
.env.env.bak
.env.env.decrypted.bak
.certs
change-summary

It also skips configured binary/generated file types such as Markdown, fonts, images, minified assets, and packages.

Sensitive-line matching covers names such as:

text
SECRET_KEY
API_KEY
PRIVATE_KEY
ACCESS_KEY
CLIENT_SECRET

and their lowercase forms. Matching is deliberately pattern-based and only redacts lines that match the implementation's sensitive-line heuristic.

Important: this is best-effort redaction, not a complete secret scanner. A repository can contain credentials under other names or in formats that do not match these patterns. Review the generated diff before sending sensitive code to a third-party provider.

3. AI Provider Boundary

AIClient sends a JSON chat-completions request containing:

  • the generated system prompt
  • the filtered/redacted diff
  • configured model parameters

The destination is determined by AIConfig.

Possible destinations include:

  • Gemini's OpenAI-compatible API
  • OpenAI
  • OpenRouter
  • Grok
  • DeepSeek
  • Ollama
  • vLLM
  • LM Studio
  • another OpenAI-compatible endpoint configured by the user

For cloud providers, the provider can therefore process the repository diff and prompt content. gitaiflow cannot control provider-side retention, logging, training, billing, or privacy policies.

For local providers such as Ollama, the request can remain within the local environment.

Credentials

AI credentials are supplied through environment variables or a .env file discovered from the current directory upward to the repository root.

Typical configuration:

text
AI_API_KEY=<secret>
AI_BASE_URL=<endpoint>
AI_MODEL=<model>

The .env file should not be committed to source control.

gitaiflow does not put the configured API key into the generated JSON or Markdown artifacts.

Local Artifacts

Normal runs create:

text
change-summary/
└── <YYYY>/<MM>/<DD>/
    ├── diff/
    ├── json/
    └── markdown/

The JSON payload intentionally contains Git/application metadata and the generated commit summary. It can include:

  • repository name
  • branch
  • base reference
  • Git author name/email
  • changed file paths and statuses
  • selected provider/model
  • generated commit title/body

Because these artifacts are local files, their confidentiality depends on the permissions and storage security of the user's machine and repository workspace.

The intermediate diff/ artifacts are also local, but they contain the filtered diff used for the current run. They should be treated as potentially sensitive even after redaction.

Local Usage Log

Usage accounting is stored locally at:

text
~/.gitaiflow/usage.jsonl

The local usage record includes operational fields such as:

  • timestamp
  • repository name
  • target type
  • provider
  • model
  • changed-file count
  • estimated input/output tokens
  • duration
  • success/failure

This local log is not transmitted unless the separate telemetry path is enabled.

Telemetry

Telemetry is disabled unless the user opts in.

Consent can be controlled with:

bash
gitaiflow --telemetry enable
gitaiflow --telemetry disable
gitaiflow --telemetry status
gitaiflow --telemetry history

For a single process/session, GITAIFLOW_TELEMETRY=true|false overrides the stored decision without changing the saved consent.

When telemetry is enabled, the transmitted run payload contains only the documented operational fields:

  • install ID
  • event type
  • timestamp
  • gitaiflow version
  • AI provider
  • model name
  • target type
  • changed-file count
  • estimated input/output token counts
  • duration
  • success/failure
  • operating-system name

The telemetry payload does not contain:

  • repository path or repository name
  • file paths
  • diff contents
  • generated summary text
  • Git author
  • Git branch
  • commit message

Telemetry uses a short request timeout and failures are non-fatal to the main gitaiflow run.

The durable consent record is stored separately from the local usage directory:

text
~/.gitaiflow_telemetry_consent

This prevents deleting ~/.gitaiflow from unintentionally changing the telemetry decision.

The consent history records the answer, gitaiflow version, and timestamp.

Privacy Boundary

The strongest privacy boundary is the choice of AI provider:

text
Local repository
      │
      ├── local-only processing ──→ Ollama / local compatible endpoint
      │
      └── external processing ────→ configured cloud AI provider

Even with redaction and telemetry disabled, a cloud AI provider still receives the diff and prompt necessary to generate the requested summary. Users should select a provider whose data-handling policy is appropriate for the repository being analyzed.

Security Recommendations

  1. Never commit .env files or API credentials.
  2. Treat change-summary/diff/ and generated JSON/Markdown artifacts as potentially sensitive.
  3. Review redaction-sensitive diffs before sending proprietary or regulated code to a cloud provider.
  4. Prefer a local provider when repository contents must remain inside the local environment.
  5. Keep telemetry disabled when anonymous operational reporting is not desired.
  6. Restrict filesystem access to repositories and generated artifacts according to the sensitivity of the source code.