[GH-ISSUE #3861] [Feature]: Custom agent repo URLs in Agents Manager (feature-flag gated) #2086

Closed
opened 2026-10-21 05:45:15 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Gunterlie on GitHub (Jul 20, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3861

Originally assigned to: @SpicyMarinara on GitHub.

Just fishing for thoughts on this one. Feedback welcome.

What problem does this solve?

Users who write their own custom agents (prompts/tooling defs) currently have no way to share them with others or sync them into the Agents Manager except manual copy/paste. There's no way to point the engine at a repo of custom agent definitions and have it pull them in — and no way to build a wider community around sharing agent setups the way people already share prompts, character cards, and configs elsewhere.

A repo-based flow would let people publish their agent collections on GitHub, point others at the URL, and let it stay in sync as they iterate.

Proposed solution

Core idea: let a user add one or more repo URLs to a list in the Agents Manager. The engine fetches agent definitions from each configured repo and makes them available/installable, similar to how capability packages are installed today. Re-syncing a repo updates the agent configs it previously imported, not just a one-time import — so a repo owner can push an improved prompt or new tool config and everyone subscribed picks it up on next sync.

This turns "custom agent" from a private, per-install thing into something shareable: someone builds a good agent, publishes the repo, and anyone can add the URL and get it (and future updates) without copy/pasting JSON around Discord/forums.

Relationship to the official catalog: community repo URLs stay unmoderated/unvetted by design (see trust warning below), but they can also act as a farm team for the official Marinara-Agents catalog. Mari's take is that genuinely good agents should be able to graduate into the curated, PastaDevs-vetted catalog repo — not that every community repo becomes catalog-equal. This issue is just the decentralized add-a-repo mechanism; promotion into the official catalog stays a separate, human-reviewed step (a maintainer pulls in / merges an agent def they've vetted), not something this feature auto-does.

Feature flag: because this pulls arbitrary user-supplied remote content into a running instance, it should ship disabled by default and gated behind an env flag (e.g. ENABLE_CUSTOM_AGENT_REPOS), following the existing isEnabledFlag() pattern used for flags like IP_ALLOWLIST_ENABLED in packages/server/src/config/runtime-config.ts.

Implementation path: reuse the existing capability-package pipeline (packages/server/src/services/capability-packages/package-manager.service.ts):

  • safeFetch() for SSRF-safe outbound requests
  • adm-zip for archive extraction, with the existing zip-slip/symlink/size-cap guards
  • packagedAgentDefinitionSchema for validating fetched agent JSON

No new git dependency and no git clone — resolve a repo URL to an archive snapshot instead (e.g. a GitHub codeload zip).

Trust/consent UX (mandatory, not optional): any third-party repo/agent is unaffiliated, unreviewed, unmoderated content run against the user's own connections and tools. Before a repo is added, and before each sync that changes an agent, the UI must show an explicit warning along the lines of:

This repo and its agents are not affiliated with or vetted by PastaDevs. Custom agents can run tools, send prompts to your configured connections, and change behavior on every sync. Only add repos from people/sources you trust.

Add this repo anyway?

This requires an explicit confirm (not a pre-checked box) to add a repo, plus a lighter-weight "this agent was updated by its remote repo" notice — with a diff/preview, not silent auto-merge — on subsequent syncs.

Key design points to nail down during implementation:

  • Repo host allowlisting — arbitrary user-supplied URLs are a bigger SSRF/abuse surface than the current fixed catalog domain
  • Stable per-agent identity (repoUrl + slug) so re-sync updates existing AgentConfig rows instead of duplicating
  • Sync policy for repo-managed agents vs. local edits — simplest: remote always wins on sync, same as capability packages today
  • Manual "sync now" trigger to start; polling/webhook auto-sync is out of scope unless separately requested
  • Imported agent prompt/settings/tool config should be reviewable before it's trusted (diff/preview on first sync and updates, not silent auto-merge into a live agent)
  • Explicit, non-dismissable-by-default trust warning on add and on any content-changing sync — security/consent requirement, not a nice-to-have

Alternatives considered

  • Real git clone of the repo — rejected. Pulls in a new dependency and a much larger attack surface (arbitrary .git hooks/submodules) for no benefit over an archive snapshot fetch.
  • No feature flag, always-on — rejected. Fetching and executing user-supplied remote agent definitions by default is not an acceptable default-on trust boundary, especially once this becomes a "install some stranger's repo" community feature.
  • Silent/no-warning install — rejected. A user adding a third-party repo needs to explicitly acknowledge it's unaffiliated, unvetted content before it's added, not just find out after the fact.

Additional context

Related existing systems this should reuse rather than duplicate:

System Path Reused for
Capability-package pipeline packages/server/src/services/capability-packages/package-manager.service.ts archive fetch/verify/extract/install
Safe outbound fetch packages/server/src/utils/security.ts (safeFetch) SSRF-safe requests
Agent definition schema packages/shared/src/schemas/capability-package.schema.ts (packagedAgentDefinitionSchema) validating fetched agent JSON
Env-flag pattern packages/server/src/config/runtime-config.ts (isEnabledFlag) the ENABLE_CUSTOM_AGENT_REPOS gate

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Gunterlie on GitHub (Jul 20, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3861 Originally assigned to: @SpicyMarinara on GitHub. _Just fishing for thoughts on this one. Feedback welcome._ ## What problem does this solve? Users who write their own custom agents (prompts/tooling defs) currently have no way to share them with others or sync them into the Agents Manager except manual copy/paste. There's no way to point the engine at a repo of custom agent definitions and have it pull them in — and no way to build a wider community around sharing agent setups the way people already share prompts, character cards, and configs elsewhere. A repo-based flow would let people publish their agent collections on GitHub, point others at the URL, and let it stay in sync as they iterate. ## Proposed solution **Core idea:** let a user add one or more repo URLs to a list in the Agents Manager. The engine fetches agent definitions from each configured repo and makes them available/installable, similar to how capability packages are installed today. Re-syncing a repo updates the agent configs it previously imported, not just a one-time import — so a repo owner can push an improved prompt or new tool config and everyone subscribed picks it up on next sync. This turns "custom agent" from a private, per-install thing into something shareable: someone builds a good agent, publishes the repo, and anyone can add the URL and get it (and future updates) without copy/pasting JSON around Discord/forums. **Relationship to the official catalog:** community repo URLs stay unmoderated/unvetted by design (see trust warning below), but they can also act as a farm team for the official `Marinara-Agents` catalog. Mari's take is that genuinely good agents should be able to graduate into the curated, PastaDevs-vetted catalog repo — not that every community repo becomes catalog-equal. This issue is just the decentralized add-a-repo mechanism; promotion into the official catalog stays a separate, human-reviewed step (a maintainer pulls in / merges an agent def they've vetted), not something this feature auto-does. **Feature flag:** because this pulls arbitrary user-supplied remote content into a running instance, it should ship **disabled by default and gated behind an env flag** (e.g. `ENABLE_CUSTOM_AGENT_REPOS`), following the existing `isEnabledFlag()` pattern used for flags like `IP_ALLOWLIST_ENABLED` in `packages/server/src/config/runtime-config.ts`. **Implementation path:** reuse the existing capability-package pipeline (`packages/server/src/services/capability-packages/package-manager.service.ts`): - `safeFetch()` for SSRF-safe outbound requests - `adm-zip` for archive extraction, with the existing zip-slip/symlink/size-cap guards - `packagedAgentDefinitionSchema` for validating fetched agent JSON No new git dependency and no `git clone` — resolve a repo URL to an archive snapshot instead (e.g. a GitHub codeload zip). **Trust/consent UX (mandatory, not optional):** any third-party repo/agent is unaffiliated, unreviewed, unmoderated content run against the user's own connections and tools. Before a repo is added, and before each sync that changes an agent, the UI must show an explicit warning along the lines of: > This repo and its agents are not affiliated with or vetted by PastaDevs. Custom agents can run tools, send prompts to your configured connections, and change behavior on every sync. Only add repos from people/sources you trust. > > **Add this repo anyway?** This requires an explicit confirm (not a pre-checked box) to add a repo, plus a lighter-weight "this agent was updated by its remote repo" notice — with a diff/preview, not silent auto-merge — on subsequent syncs. **Key design points to nail down during implementation:** - Repo host allowlisting — arbitrary user-supplied URLs are a bigger SSRF/abuse surface than the current fixed catalog domain - Stable per-agent identity (`repoUrl` + slug) so re-sync updates existing `AgentConfig` rows instead of duplicating - Sync policy for repo-managed agents vs. local edits — simplest: remote always wins on sync, same as capability packages today - Manual "sync now" trigger to start; polling/webhook auto-sync is out of scope unless separately requested - Imported agent prompt/settings/tool config should be reviewable before it's trusted (diff/preview on first sync and updates, not silent auto-merge into a live agent) - Explicit, non-dismissable-by-default trust warning on add and on any content-changing sync — security/consent requirement, not a nice-to-have ## Alternatives considered - **Real `git clone` of the repo** — rejected. Pulls in a new dependency and a much larger attack surface (arbitrary `.git` hooks/submodules) for no benefit over an archive snapshot fetch. - **No feature flag, always-on** — rejected. Fetching and executing user-supplied remote agent definitions by default is not an acceptable default-on trust boundary, especially once this becomes a "install some stranger's repo" community feature. - **Silent/no-warning install** — rejected. A user adding a third-party repo needs to explicitly acknowledge it's unaffiliated, unvetted content before it's added, not just find out after the fact. ## Additional context Related existing systems this should reuse rather than duplicate: | System | Path | Reused for | |---|---|---| | Capability-package pipeline | `packages/server/src/services/capability-packages/package-manager.service.ts` | archive fetch/verify/extract/install | | Safe outbound fetch | `packages/server/src/utils/security.ts` (`safeFetch`) | SSRF-safe requests | | Agent definition schema | `packages/shared/src/schemas/capability-package.schema.ts` (`packagedAgentDefinitionSchema`) | validating fetched agent JSON | | Env-flag pattern | `packages/server/src/config/runtime-config.ts` (`isEnabledFlag`) | the `ENABLE_CUSTOM_AGENT_REPOS` gate | ## Template check - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 20, 2026):

Claiming this for SpicyMarinara. I’ll implement it in a separate, feature-flagged PR against staging with manual-only sync, explicit trust confirmation, SSRF/ZIP/schema validation, stable source identity, and preview-before-apply so remote changes cannot silently overwrite local state.

<!-- gh-comment-id:5022596731 --> @SpicyMarinara commented on GitHub (Jul 20, 2026): Claiming this for SpicyMarinara. I’ll implement it in a separate, feature-flagged PR against staging with manual-only sync, explicit trust confirmation, SSRF/ZIP/schema validation, stable source identity, and preview-before-apply so remote changes cannot silently overwrite local state.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 20, 2026):

Implementation is now tracked in draft PR #3863: https://github.com/Pasta-Devs/Marinara-Engine/pull/3863

<!-- gh-comment-id:5022604049 --> @SpicyMarinara commented on GitHub (Jul 20, 2026): Implementation is now tracked in draft PR #3863: https://github.com/Pasta-Devs/Marinara-Engine/pull/3863
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2086
No description provided.