Skip to main content

Polaris/integrations/deepseek-harness

196Stars26Forks6Issues1Watchers

Integrate the tools and skills catalog from the Polaris platform into DeepSeek Harness, and enforce the permitted tool policies declared in skills during the current DSH turn execution.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
Python
License
Apache-2.0
Branch
main
ai-agentsai-scientistauto-researchdsh-pluginpolaris-agent

Install

cmdweb profile
$ dsh plugin --profile web add github:ZJU-REAL/Polaris#path:integrations/deepseek-harness

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin ZJU-REAL/Polaris/integrations/deepseek-harness for me: review the repository at https://github.com/ZJU-REAL/Polaris first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-Sentence Positioning

This is a connector plugin that integrates the Polaris platform into DeepSeek Harness (DSH). It pulls Polaris backend's MCP tool list into DSH on one side, and injects Polaris assistant skills into DSH as native skills (rather than MCP tools) on the other side, and enforces the "allowed-tools" policy declared by each skill into the current DSH turn.

Core Capabilities

  • Connect to Polaris /mcp through DSH's official MCP client, inject Polaris tools (like search_papers) into DSH tool directory with mcp__polaris__* namespace
  • As a native skill provider, regularly pulls the Polaris skill directory and registers Polaris assistant skills into DSH's native skill system
  • Registers polaris_skill_resource tool to read skill declaration attachment content on demand (only paths explicitly listed by the skill are readable)
  • Based on Polaris skills loaded in the current turn, hides Polaris tools outside its allowed-tools whitelist at the tool layer, and performs guard interception on tools discovered later in the turn
  • When multiple skills are loaded in the same turn, automatically takes the intersection of their allowed tools lists, only tightening rather than loosening
  • When tokens expire (401/403) or permissions are downgraded, automatically clears cache and marks DSH skill discovery as invalid, achieving fail-close

Technical Implementation

  • Language: TypeScript (ESM, tsconfig.json builds to dist/)
  • Key dependencies: @deepseek-ai/dsh-mcp-client (official MCP bridge), @deepseek-ai/schemastery (config schema), zod (runtime data structure validation), @deepseek-ai/cordis (host injection)
  • Architecture pattern: Dual-adapter bundle. cordis.patch.yml inserts two services into the host at startup: polaris-mcp (via official MCP client) and polaris-skills (native provider from this plugin). The plugin then tracks turn state through Cordis hooks (tools/post-execute, agent/pre-step, tools/change, agent/disposed, agent/error, agent/turn-stopping)
  • Entry point: integrations/deepseek-harness/src/index.ts (apply(ctx, config) is the plugin activation entry)

Use Cases

Users who have deployed a Polaris instance and want DSH to both call Polaris's exposed MCP tools and leverage Polaris's assistant skills to uniformly manage team prompts and triggering rules. It treats skills as native first-class citizens in DSH, avoiding the misregistration issue where skills are misplaced as MCP tools; simultaneously, through the allowed-tools policy, individual skills can declare their own tool whitelist, preserving Polaris tools while preventing privilege escalation.

Prerequisites & Compatibility

DependencyMinimum VersionDescription
DeepSeek Harness0.1.0-rc.6Plugin peerDependencies declares cordis, dsh-agent, dsh-session, dsh-skill, dsh-tools all as ^0.1.0-rc.6
Node.js>=20engines.node field; required for local bundle building
PlatformCross-platformNo os / cpu restrictions declared
Native modulesNoneDependencies are pure JS/TS packages, no node-gyp modules
Polaris backendDatabase migration 8ff89f7fcdebOtherwise /api/integrations/deepseek-harness/v1/skills* endpoints unavailable

Installation

dsh plugin --profile web add github:ZJU-REAL/Polaris/integrations/deepseek-harness

Configuration Options

Environment variables are read by cordis.patch.yml when the plugin is injected, and the patch line also accepts same-name config field overrides.

ConfigTypeDescriptionDefault
POLARIS_BASE_URLEnvironment variable / stringPolaris service root address, automatically strips trailing slash and appends /mcphttp://127.0.0.1:8000
POLARIS_DSH_TOKENEnvironment variable / stringIntegration token plaintext, created via /api/integration-tokens, scopes require at least skills:read and mcp:readempty
POLARIS_DSH_TOOL_PROFILEEnvironment variable / stringBackend MCP profile; dsh-readonly-v1 is read-only, dsh-full-v1 additionally exposes remember (and only when account has Buddy memory enabled)dsh-readonly-v1
baseUrlField (override env)Same as POLARIS_BASE_URL, used to bypass environment variables for direct passingRequired
tokenField (override env)Same as POLARIS_DSH_TOKEN, marked as secret field by schemasteryRequired
serverNameStringMCP namespace, must match official client rowpolaris
refreshIntervalMsNumber, ≥1000Skill directory polling interval30000
requestTimeoutMsNumber, ≥1Polaris single discovery request timeout10000
failOnStartupErrorBooleanWhether to interrupt DSH startup if skill discovery fails at startupfalse
allowedToolsModeEnumSkill allowed-tools policy enforcement strength: enforce hides and intercepts violating tools; advisory only logs warnings; off completely disables policyenforce
userSkillRankNumberDSH candidate ranking for user-scoped Polaris skills340
builtinSkillRankNumberDSH candidate ranking for builtin-scoped Polaris skills360

FAQ

Q: What environment variables must be set after installation?

A: At minimum POLARIS_BASE_URL and POLARIS_DSH_TOKEN, otherwise the plugin will throw an error immediately during client construction due to empty token. If using dsh-full-v1 profile, the backend account also needs Buddy memory enabled, otherwise the remember tool won't appear in the discovery list.

Q: How do I grant permissions for the integration token?

A: Use the current logged-in JWT to call POST /api/integration-tokens, select scopes. skills:read is used for skill discovery and reading, mcp:read is used for connecting to /mcp, mcp:write is used to open write tool profile. The token plaintext only appears once in the creation response; the Polaris backend only stores SHA-256 hash, so it must be recreated if lost. Created token scopes cannot be edited, only revoked and recreated.

Q: How do I verify the plugin is active?

A: Run dsh --profile web --dump-config before DSH profile startup; the config should show both polaris-mcp and polaris-skills lines; after startup, DSH's tool directory should contain tools like mcp__polaris__search_papers, and Polaris backend's skill_load won't appear as an MCP tool (it's carried by DSH's native skill tool).

Q: How do I write allowed-tools in skills correctly?

A: Must be Polaris original tool names (like search_papers), not DSH namespace forms like mcp__polaris__search_papers; when multiple Polaris skills load in the same turn, their allowed lists automatically take intersection, won't expand the tool set, nor restrict non-Polaris DSH tools; allowed-tools: null means no additional restrictions.

Q: What happens when token is revoked or account is downgraded to read-only?

A: Skill discovery encountering 401 or 403 will immediately clear cached skill directory and mark DSH discovery as invalid; if next request still doesn't recover, it will directly reject; after backend downgrades account to read-only, even if token declares write scope, it will be rejected on next request at /mcp, not just the browser session affected.

Q: How to choose between the three allowedToolsMode modes?

A: Default enforce hides violating Polaris tools from tool directory and synchronously intercepts newly discovered tools in the turn; advisory only logs without interception, suitable for troubleshooting before going live; off completely disables policy, turns off the entire policy controller, suitable for reducing event loop overhead when Polaris backend hasn't declared any policies.

Difficulty Level

Advanced — requires preparing database migration and integration token on Polaris backend first, understanding the relationship between DSH profile, cordis patch and environment variables, and being able to distinguish between enforce/advisory/off three policy strengths to avoid misinterception.

Known Issues & Limitations

  • Polaris backend must apply migration 8ff89f7fcdeb, otherwise skill-related endpoints are unavailable
  • Integration token scopes cannot be edited after creation, can only be recreated via DELETE /api/integration-tokens/{id}; serverName must match official MCP client row, otherwise policy matching will fail
  • Skill attachment paths reject empty segments, . and .. segments on client side (src/client.ts:84), preventing undeclared path bypass validation to redirect requests
  • When Polaris account is read-only, even if token declares mcp:write, it will be rejected on /mcp; the only write tool in dsh-full-v1, remember, only appears in discovery and call lists after account enables Buddy memory
  • No TODO / FIXME / HACK comments in source code, no explicitly marked bugs currently identified

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/ZJU-REAL/Polaris/integrations/deepseek-harness)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory