Skip to content

feat: add agent export and import functionality#4251

Open
abhinav-m22 wants to merge 29 commits intoarchestra-ai:mainfrom
abhinav-m22:feat/import-export-agent
Open

feat: add agent export and import functionality#4251
abhinav-m22 wants to merge 29 commits intoarchestra-ai:mainfrom
abhinav-m22:feat/import-export-agent

Conversation

@abhinav-m22
Copy link
Copy Markdown
Contributor

@abhinav-m22 abhinav-m22 commented May 1, 2026

/claim #4201

This PR introduces the ability to export an agent's configuration into a JSON file and import it into any other Archestra instance. This enables teams to move agents seamlessly across multi-environment setups (dev to staging to prod) and share configurations easily.

Features & Functionality

  • Export Endpoint: GET /api/agents/:id/export generates a self-contained JSON schema representing the agent. Internal UUIDs are stripped out and replaced with portable names.
  • Import Endpoint: POST /api/agents/import accepts the JSON payload, creates the agent, and intelligently resolves associations (Tools, Knowledge Bases, Connectors, Delegations) by name against the local registry.
  • Strict Validation & Security: Association assignments (tools, KBs, delegations) strictly respect the importing user's RBAC visibility and team scoping.

Security Constraints & Edge Cases

  • Import may return non-blocking warnings when tools/KBs/connectors/delegations can’t be resolved or assigned locally (e.g., remote MCP tools without required installations or credentials); the agent is still created, but those associations are skipped.
  • Built-in Agents: Exporting built-in agents is explicitly forbidden (returns 400). They contain internal, non-portable configurations.
  • Secret Exclusion: Security fields like identityProviderId and llmApiKeyId are intentionally excluded from the export payload because they contain instance-specific secrets.
  • Imported agents are always forced to personal scope by default to prevent privilege escalation.

Demo showing both successful imports (no warnings) and imports with warnings for remote MCP tools:

Screencast.From.2026-05-01.17-12-37.mp4

@abhinav-m22 abhinav-m22 changed the title [WIP] feat: add agent export and import functionality feat: add agent export and import functionality May 1, 2026
@abhinav-m22 abhinav-m22 marked this pull request as ready for review May 1, 2026 12:52
@abhinav-m22
Copy link
Copy Markdown
Contributor Author

Should we support importing MCP gateway and LLM proxy agent types, or restrict it to the standard agent type only? For now, this implementation restricts import/export to the agent type to keep v1 simple and stable.

@github-actions github-actions Bot requested a review from iskhakov May 5, 2026 15:25
@abhinav-m22
Copy link
Copy Markdown
Contributor Author

Hi @joeyorlando 👋
Just wanted to kindly follow up on this PR as well. I completely understand things may be busy. Would really appreciate a review whenever feasible. Thanks 🙏

@joeyorlando
Copy link
Copy Markdown
Contributor

hey @abhinav-m22 👋 thank you for the ping!

On first glance this makes sense. I will take a deeper review soon 🙂

My first comment would be that in the actions column for Agents, I think we should "simplify" that a bit - I would propose showing Connect, Chat, and Edit Icons followed by a "three dots" icon/button which opens a "pop-over" with the remaining actions. Does that make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to Export and Import Agent configurations

2 participants