Skip to content

Feat/deploy ai agent prompt - #835

Merged
thisrohangupta merged 2 commits into
harness:mainfrom
akmadan:feat/deploy-ai-agent-prompt
Aug 24, 2026
Merged

Feat/deploy ai agent prompt#835
thisrohangupta merged 2 commits into
harness:mainfrom
akmadan:feat/deploy-ai-agent-prompt

Conversation

@akmadan

@akmadan akmadan commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a deploy-ai-agent prompt template (src/prompts/deploy-ai-agent.ts) that walks an end-to-end workflow for shipping an AI agent from an IDE to a cloud agent runtime (Google Agent Runtime or AWS AgentCore) via Harness CD.
  • The workflow (Phases A–G): get code into a Harness-reachable repo → confirm target platform → build & push the agent image (CI) → ensure connectors → create the AiAgent service → create environment + infrastructure → add the CD deploy stage and run it, with a failure/retry loop.
  • Registers the prompt in src/prompts/index.ts and adds tests/prompts/deploy-ai-agent.test.ts (9 tests). README prompt count regenerated 34 → 35.

Why

Harness CD recently shipped AI agent deployment (service type AiAgent; infra kinds GoogleAgentRuntime / AwsAgentCore). This prompt brings that flow to the MCP server so an IDE coding agent can drive "ship this agent" reliably.

The prompt encodes the non-obvious contract:

  • The agent image is a URI string on the service source (platform.spec.source.spec.image), not an artifact source.
  • A build step is mandatory (only source type is a pre-built container).
  • The built image is chained into the service via a shared <+pipeline.sequenceId> tag.
  • AwsAgentCore requires executionRoleArn.
  • Deploy/Shift/Rollback steps read the image from the service at runtime — never from the step.

It embeds the CI BuildAndPushGAR / BuildAndPushECR steps and all six CD steps (Deploy/Shift/Rollback per platform).

Notes

  • Pure prompt addition — no new tools, no registry/schema changes.
  • harness_schema in the prompt relies on live NG /yaml-schema fallback to surface the AiAgent types on FF-enabled accounts (no snapshot re-vendoring included).

Test plan

  • pnpm typecheck — clean
  • pnpm standards:check — 77/77
  • pnpm docs:check — README up to date
  • pnpm test tests/prompts/ — 72/72 (incl. 9 new)
  • Confirm NG /yaml-schema surfaces AiAgent under the FF before merge

akmadan and others added 2 commits August 18, 2026 12:07
Adds a `deploy-ai-agent` prompt template that walks an end-to-end
workflow for shipping an AI agent from an IDE to a cloud agent runtime
(Google Agent Runtime or AWS AgentCore) via Harness CD: get the code
into a repo, build & push the agent image (CI), then create the AiAgent
service, environment, infrastructure, and a build-to-deploy pipeline.

The prompt encodes the non-obvious contract for AI agent deployment:
the agent image is a URI string on the service source (not an artifact
source), a build step is mandatory, the image is chained via a shared
`<+pipeline.sequenceId>` tag, and AwsAgentCore requires executionRoleArn.
It embeds the CI BuildAndPushGAR/ECR steps and all six CD steps
(Deploy/Shift/Rollback for each platform).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Verified against the live NG /yaml-schema endpoint: GoogleAgentSource
and AwsCoreAgentSource gate their container spec on type const
"container" (lowercase), not "Container". Correct the embedded service
YAML in both platform blocks and add a regression assertion.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@cursor

cursor Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Review summary

Solid addition — the phased A→G workflow mirrors build-deploy-app well, and the prompt correctly encodes the non-obvious AiAgent CD contract (lowercase container source discriminator, image URI on the service — not artifact source — <+pipeline.sequenceId> tag chaining, executionRoleArn for AwsAgentCore). The second commit fixing the container discriminator + the regression test show good schema diligence.

I ran the new test file locally: 9/9 passing.

Verdict: Approve with suggestions — none are blockers, but a few gaps could cause agent confusion during real "ship from IDE" runs.

Strengths

  • Clear phase ordering with confirmation gates before writes
  • Platform-specific YAML for both GoogleAgentRuntime and AwsAgentCore (build, service, infra, deploy/shift/rollback)
  • registerAllPrompts wiring test guards against accidental removal
  • README prompt count bump (34 → 35) satisfies docs:check

Suggestions (see inline)

  1. Add Dockerfile / container-build prerequisites in Phase C (similar to build-deploy-app Phase 1)
  2. Include a minimal full-pipeline skeleton in Phase G (codebase + CI stage + CD stage wiring), not just deploy steps
  3. Document the hardcoded deploy stage identifier used in the revisionId expression
  4. Consider adding org_id alongside projectId for scope symmetry
  5. Clarify in the description that this deploys an AiAgent CD runtime — distinct from the create-agent prompt (Harness AI agent templates)
  6. Add a row to the README MCP Prompts → DevOps table for discoverability (count-only update isn't enough for users browsing the table)
  7. Open test-plan item: confirm NG /yaml-schema surfaces AiAgent on FF-enabled accounts before merge (entity schemas aren't vendored yet)

Happy to re-review after updates.

Comment thread src/prompts/deploy-ai-agent.ts
Comment thread src/prompts/deploy-ai-agent.ts
Comment thread src/prompts/deploy-ai-agent.ts
Comment thread src/prompts/deploy-ai-agent.ts
Comment thread src/prompts/deploy-ai-agent.ts
Comment thread README.md
@thisrohangupta
thisrohangupta merged commit ac77eaa into harness:main Aug 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants