Skip to content

feat: add ability to edit harness configuration after creation #1102

@aidandaly24

Description

@aidandaly24

Description

There is no way to edit a harness's configuration after the initial agentcore add harness flow. If a user needs to change the system prompt, swap a model, add/remove tools, or fix a misconfigured gateway tool, they have no CLI-native path to do so.

This is especially painful for gateway tools within a harness. When a gateway is added during harness creation, the ARN and auth config are written to app/<harnessName>/harness.json — a file users don't know exists. If the gateway ARN or OAuth config is wrong, deployments fail with no discoverable way to fix it from the CLI.

Current Behavior

HarnessPrimitive only implements add() and remove(). All harness configuration is written once during add():

  • Harness specapp/<harnessName>/harness.json (via configIO.writeHarnessSpec())
  • System promptapp/<harnessName>/system-prompt.md
  • Project referenceagentcore/agentcore.json

Properties that cannot be changed after creation:

  • System prompt
  • Model provider / model ID
  • Tools (browser, code_interpreter, MCP servers, gateway ARN + auth config)
  • Max iterations, max tokens, timeout
  • Truncation strategy
  • Network mode, subnets, security groups
  • Container URI / Dockerfile path
  • Authentication configuration

The only workarounds are:

  1. Manually edit app/<harnessName>/harness.json (undiscoverable)
  2. agentcore remove harness + agentcore add harness (destructive — loses customizations)

Expected Behavior

Users should be able to edit harness configuration after creation. For example:

agentcore edit harness
agentcore edit harness --name <harness-name>

This could re-enter the wizard with current values as defaults, or open the config in an editor, or support targeted flag-based edits — whatever fits the CLI's UX patterns best.

Relevant Code

  • Harness spec written (once): src/cli/primitives/HarnessPrimitive.ts line ~177
  • System prompt written (once): src/cli/primitives/HarnessPrimitive.ts lines ~178-183
  • Gateway tool config built during add: src/cli/primitives/HarnessPrimitive.ts lines 110-138
  • Harness spec file path: app/<harnessName>/harness.json (via PathResolver.getHarnessConfigPath())
  • Tools passed to API unchanged on deploy: src/cli/operations/deploy/imperative/deployers/harness-mapper.ts lines 248-254
  • No update() or edit() method on HarnessPrimitive or BasePrimitive

Impact

Harness iteration is a core development workflow. Users frequently need to tweak system prompts, swap models, fix gateway ARNs, or add/remove tools. Currently, any mistake during initial creation forces users out of the CLI workflow — either manually editing files they don't know about, or destroying and recreating the entire harness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions