Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .antigravity-plugin/rules/monk-safety.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ needed.

- Cloud deploys, destructive actions, workload shells, and credential changes require approval
through `monk-agent`.
- Never pass both `mode` and `target` to `monk.project.deploy`; `target:"local"` silently deploys locally even when `mode` is `"cluster"`. Pass only `mode`.
- Cluster creation, grow, peer removal, peer retagging, registry changes, exit, and delete must go
through `monk.cluster.*` tools.
- Never target Monk-managed `system/*` workloads.
Expand Down
5 changes: 3 additions & 2 deletions .antigravity-plugin/skills/monk/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Prefer `monk-agent` MCP tools and resources:
- `monk.rbac.role`
- `monk.project.analyze`
- `monk.project.configure`
- `monk.project.deploy`
- `monk.project.deploy` (never pass both `mode` and `target`; `target:"local"` silently deploys locally)
- `monk.environment.list`
- `monk.environment.select`
- `monk.environment.delete`
Expand Down Expand Up @@ -265,6 +265,7 @@ open the required approval flow when needed.
again to verify.
- Cloud deploys, destructive actions, workload shells, and credential changes
require approval through `monk-agent`.
- Never pass both `mode` and `target` to `monk.project.deploy`; `target:"local"` silently deploys locally even when `mode` is `"cluster"`. Pass only `mode` (`"local"` or `"cluster"`). Confirm `monk://workspace/cluster-context` before a cluster deploy — do not add `target:"local"` as a fallback.
- Workload lifecycle verbs are distinct. `load` makes templates available;
`run` starts a not-yet-running workload; `update` changes a running workload;
`stop` takes it offline while preserving state; `delete`/`purge` removes
Expand Down Expand Up @@ -395,7 +396,7 @@ For a first deploy:
6. If user-provided secrets or provider credentials are required, request them
through the local secure web form.
7. If deploying to cloud or making a risky change, request approval.
8. Deploy with `monk.project.deploy`.
8. Deploy with `monk.project.deploy`. Never pass both `mode` and `target`; `target:"local"` silently deploys locally even when `mode` is `"cluster"`. Pass only `mode`.
9. Verify the returned endpoint/status from outside the deploy operation.

Monk usually deploys projects in 20-40 minutes. Set that expectation when
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/install-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ jobs:
shell: bash
run: ./tests/start-monk-agent-antigravity-python-path.sh

- name: Check deploy conflicting mode+target skill guard
shell: bash
run: ./tests/deploy-conflicting-mode-target-guard.sh

windows:
name: windows-latest
runs-on: windows-latest
Expand Down
2 changes: 1 addition & 1 deletion agents/monk-deployer.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ with no local build), skip this section and continue from step 5 above.
packages/entities to generated secret references. Consumers read generated
secrets by reference through connections or entity state and must have
`permitted-secrets` or equivalent package permissions.
- Deploy with `monk.project.deploy`.
- Deploy with `monk.project.deploy`. Never pass both `mode` and `target`; `target:"local"` silently deploys locally even when `mode` is `"cluster"`. Pass only `mode`.

## Cluster operations

Expand Down
2 changes: 1 addition & 1 deletion agents/monk-frontman.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Blocked shell work:
- Deploy-time provider and MANIFEST credentials are collected through
`monk.credentials.request`; never ask the user to paste values in chat. Use
`monk.secret.request` only for a single ad hoc secret with no provider
mapping.
mapping. Never pass both `mode` and `target` to `monk.project.deploy`; `target:"local"` silently deploys locally even when `mode` is `"cluster"`. Pass only `mode`.
- MANIFEST `SECRET` entries are only for values the user must provide. Some
packages and entities write generated secrets to named references, such as
database passwords; consumers should read those references through
Expand Down
5 changes: 3 additions & 2 deletions plugins/monk/skills/monk/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Prefer `monk-agent` MCP tools and resources:
- `monk.rbac.role`
- `monk.project.analyze`
- `monk.project.configure`
- `monk.project.deploy`
- `monk.project.deploy` (never pass both `mode` and `target`; `target:"local"` silently deploys locally)
- `monk.environment.list`
- `monk.environment.select`
- `monk.environment.delete`
Expand Down Expand Up @@ -318,6 +318,7 @@ open the required approval flow when needed.
them directly in the main agent.
- Cloud deploys, destructive actions, workload shells, and credential changes
require approval through `monk-agent`.
- Never pass both `mode` and `target` to `monk.project.deploy`; `target:"local"` silently deploys locally even when `mode` is `"cluster"`. Pass only `mode` (`"local"` or `"cluster"`). Confirm `monk://workspace/cluster-context` before a cluster deploy — do not add `target:"local"` as a fallback.
- Workload lifecycle verbs are distinct. `load` makes templates available;
`run` starts a not-yet-running workload; `update` changes a running workload;
`stop` takes it offline while preserving state; `delete`/`purge` removes
Expand Down Expand Up @@ -477,7 +478,7 @@ For a first deploy:
6. If user-provided secrets or provider credentials are required, request them
through the local secure web form.
7. If deploying to cloud or making a risky change, request approval.
8. Deploy with `monk.project.deploy`.
8. Deploy with `monk.project.deploy`. Never pass both `mode` and `target`; `target:"local"` silently deploys locally even when `mode` is `"cluster"`. Pass only `mode`.
9. Verify the returned endpoint/status from outside the deploy operation.

Monk usually deploys projects in 20-40 minutes. Set that expectation when
Expand Down
4 changes: 2 additions & 2 deletions plugins/monk/skills/monk/references/agent-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ take with Monk, check official docs at `docs.monk.io` and use
10. Request deploy-time provider and MANIFEST credentials through
`monk.credentials.request`; use `monk.secret.request` only for a single ad
hoc secret with no provider mapping.
11. Deploy with `monk.project.deploy`; privileged tools open their own approval
flow when needed.
11. Deploy with `monk.project.deploy`. Never pass both `mode` and `target`; `target:"local"` silently deploys locally even when `mode` is `"cluster"`.
Pass only `mode`. Privileged tools open their own approval flow when needed.
12. Verify the app or workload externally.

For cluster work, first resolve scope: call `monk.scope.status` and, if the
Expand Down
5 changes: 3 additions & 2 deletions skills/monk/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Prefer `monk-agent` MCP tools and resources:
- `monk.rbac.role`
- `monk.project.analyze`
- `monk.project.configure`
- `monk.project.deploy`
- `monk.project.deploy` (never pass both `mode` and `target`; `target:"local"` silently deploys locally)
- `monk.environment.list`
- `monk.environment.select`
- `monk.environment.delete`
Expand Down Expand Up @@ -318,6 +318,7 @@ open the required approval flow when needed.
them directly in the main agent.
- Cloud deploys, destructive actions, workload shells, and credential changes
require approval through `monk-agent`.
- Never pass both `mode` and `target` to `monk.project.deploy`; `target:"local"` silently deploys locally even when `mode` is `"cluster"`. Pass only `mode` (`"local"` or `"cluster"`). Confirm `monk://workspace/cluster-context` before a cluster deploy — do not add `target:"local"` as a fallback.
- Workload lifecycle verbs are distinct. `load` makes templates available;
`run` starts a not-yet-running workload; `update` changes a running workload;
`stop` takes it offline while preserving state; `delete`/`purge` removes
Expand Down Expand Up @@ -477,7 +478,7 @@ For a first deploy:
6. If user-provided secrets or provider credentials are required, request them
through the local secure web form.
7. If deploying to cloud or making a risky change, request approval.
8. Deploy with `monk.project.deploy`.
8. Deploy with `monk.project.deploy`. Never pass both `mode` and `target`; `target:"local"` silently deploys locally even when `mode` is `"cluster"`. Pass only `mode`.
9. Verify the returned endpoint/status from outside the deploy operation.

Monk usually deploys projects in 20-40 minutes. Set that expectation when
Expand Down
4 changes: 2 additions & 2 deletions skills/monk/references/agent-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ take with Monk, check official docs at `docs.monk.io` and use
10. Request deploy-time provider and MANIFEST credentials through
`monk.credentials.request`; use `monk.secret.request` only for a single ad
hoc secret with no provider mapping.
11. Deploy with `monk.project.deploy`; privileged tools open their own approval
flow when needed.
11. Deploy with `monk.project.deploy`. Never pass both `mode` and `target`; `target:"local"` silently deploys locally even when `mode` is `"cluster"`.
Pass only `mode`. Privileged tools open their own approval flow when needed.
12. Verify the app or workload externally.

For cluster work, first resolve scope: call `monk.scope.status` and, if the
Expand Down
35 changes: 35 additions & 0 deletions tests/deploy-conflicting-mode-target-guard.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env sh
# Coding agents read these files before calling monk.project.deploy.
# Passing both mode and target with any local signal silently deploys
# locally even when mode is cluster (#318). Every instruction surface
# must say so, and the two packaged SKILL copies must stay identical.
set -eu

repo="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)"

cmp "$repo/skills/monk/SKILL.md" "$repo/plugins/monk/skills/monk/SKILL.md"
cmp "$repo/skills/monk/references/agent-workflow.md" \
"$repo/plugins/monk/skills/monk/references/agent-workflow.md"

require() {
file="$1"
needle="$2"
if ! grep -F -q "$needle" "$file"; then
echo "missing '$needle' in $file" >&2
exit 1
fi
}

for f in \
"$repo/skills/monk/SKILL.md" \
"$repo/plugins/monk/skills/monk/SKILL.md" \
"$repo/skills/monk/references/agent-workflow.md" \
"$repo/plugins/monk/skills/monk/references/agent-workflow.md" \
"$repo/agents/monk-deployer.md" \
"$repo/agents/monk-frontman.md" \
"$repo/.antigravity-plugin/skills/monk/SKILL.md" \
"$repo/.antigravity-plugin/rules/monk-safety.md"
do
require "$f" 'both `mode` and `target`'
require "$f" 'silently deploys locally'
done