dsh-git-forge: Git Credential and Push Permission Manager for DeepSeek Harness

Introduction

The design philosophy of DeepSeek Harness is “Everything is a plugin”. When an agent needs to operate on Git, safely managing credentials and controlling push permissions are common requirements. The dsh-git-forge plugin solves this problem by providing an account vault, per-project authorization, and push policy management.

This plugin focuses on HTTPS Git operations within the DSH agent shell. It does not involve SSH remotes or system gh auth; instead, through automatic credential injection and a hard interception mechanism, it ensures that only authorized accounts and hosts are permitted to push.

Core Capabilities

The plugin includes the following main features:

  • Account Vault: Aggregated by gitHost, supporting API token detection and validation.
  • Project-based Authorization: Uses the DSH session workspace as the key (projectPathKey) to determine which account the agent should use.
  • Push Interception: Implements hard interception at the Host tools.guard level to reject unauthorized pushes.
  • Agent HTTPS Git: The helper automatically injects credentials to ensure the agent can execute fetch and push.
  • Token Storage: Tokens are stored exclusively in the host-side secrets.json and do not enter the model context.
  • Model Tools: Provides read-only actions (list_accounts, list_project_accounts, get_policy, check_remote).
  • UI Alignment: Shares the sidebar interaction style with dsh-ssh-tunnel.

Installation and Activation

Use the official installation command to add the plugin:

dsh plugin --profile <profile> add "dsh-git-forge"

After installation is complete, you must refresh your browser page to see the “Git Credentials” entry in the right sidebar.

Usage Flow

  1. Open the right sidebar “Git Credentials” → Account Vault, and add an account (enter token and probe).
  2. Switch to Project Authorization → check the account and save; the current workspace is now authorized.
  3. Let the agent run HTTPS git fetch / git push within the project; credentials are injected automatically by the helper.
  4. Try pushing to an unauthorized host; the interceptor should directly reject the operation.

Model Tools

The plugin provides four read-only tool actions:

Action Description Parameters
GitForge action=list_accounts Lists the account vault (excluding tokens) None
GitForge action=list_project_accounts Lists authorized accounts for a specific project project_path
GitForge action=get_policy Views the project policy (accounts, enforcePush, default policy) project_path
GitForge action=check_remote Validates if a specific remote URL is allowed for pushing url (Required)

Data and Security

  • Data Storage: All data is located in the $DSH_HOME/git-forge/ directory, including account metadata, tokens, and authorization policies.
  • Security Mechanisms:
    • Tokens do not appear in API results, tool results, or the model context.
    • Push policies are strictly intercepted at the Host tools.guard level, without relying on model compliance.
    • If no authorization is configured for a project, the push interceptor defaults to non-intercepting.
    • The sidebar API performs Same-Origin checks (Sec-Fetch-Site or consistency check between Origin and Host).
    • Known push detection is based on command text heuristics, which possesses a bypass surface (e.g., renaming git via env variables, git aliases, wrappers, etc.).

Environment Requirements

  • DSH Version: >=0.2.0-rc.2 <0.3.0-0
  • Node.js Version: >= 20

Conclusion

dsh-git-forge is a practical tool focused on Git credential and permission control, suitable for scenarios requiring granular management of agent Git operations. Its MIT license allows for free use and modification. For more details, please visit the GitHub Repository.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye