Skip to content

security: Phase 2 high-priority fixes and UI improvements#42

Merged
initializ-mk merged 4 commits intomainfrom
security/phase2-high-fixes
Apr 4, 2026
Merged

security: Phase 2 high-priority fixes and UI improvements#42
initializ-mk merged 4 commits intomainfrom
security/phase2-high-fixes

Conversation

@initializ-mk
Copy link
Copy Markdown
Contributor

Summary

  • H-1 through H-10 security fixes: Rate limiting, request size limits, Telegram webhook auth, Slack event dedup, npx --no-install, trust policy defaults, symlink handling in scanner, custom tool entrypoint validation, and secret reuse detection
  • Scoped env vars: GH_CONFIG_DIR to gh binary, KUBECONFIG/NO_PROXY to kubectl/helm binaries
  • CLI fixes: kubectl auth, cli_execute file attachment behavior, SilenceUsage on run/serve commands
  • UI agent start error feedback: Capture stderr, verify PID liveness, extract Error: lines from serve.log, display errors in agent cards
  • Q&A behavior: Suppress continuation nudges for informational conversations, add web_search to no_pii guardrail allow_tools
  • Chat streaming: Stream agent text responses in real-time via status/result SSE events instead of waiting for stream close
  • Skill Builder: Load agent .env and encrypted secrets when checking API key availability

Test plan

  • Run go test ./... in forge-core, forge-cli, forge-plugins, forge-skills
  • Verify rate limiting returns 429 on burst requests
  • Verify oversized request body returns 413
  • Start agent with missing env var — confirm error shown in UI card
  • Chat with agent — confirm response streams in real-time
  • Ask Q&A question (e.g. "what are the top news?") — confirm no "You stopped" nudge
  • Verify Skill Builder shows correct API key status
  • Verify symlinks outside agent root are rejected by scanner

kubectl fails with "the server has asked for the client to provide
credentials" because cli_execute overrides HOME to workDir, so
kubectl can't find ~/.kube/config.

Fix:
- Set KUBECONFIG to real ~/.kube/config for kubectl/helm only (same
  pattern as GH_CONFIG_DIR for gh)
- Set NO_PROXY with K8s API server host extracted from kubeconfig,
  plus localhost/common local addresses, so kubectl's mTLS/bearer
  auth isn't broken by the egress proxy
- Both env vars scoped to kubectl/helm binaries only
Two fixes:

1. KUBECONFIG/NO_PROXY for kubectl: When HOME is overridden to workDir,
   kubectl can't find ~/.kube/config. Set KUBECONFIG to the real path
   (scoped to kubectl/helm only). Also set NO_PROXY with the K8s API
   server host extracted from kubeconfig so kubectl's mTLS/bearer auth
   isn't broken by the egress proxy.

2. Skip file part creation for cli_execute: cli_execute is an
   intermediate tool — the LLM should analyze its output and write a
   human-readable report. Attaching raw cli_execute JSON as a file
   causes the LLM to say "see attached" instead of synthesizing a
   markdown triage report. File parts are still created for
   file_create and script-backed skill tools.
- Add web_search to no_pii guardrail allow_tools so search results
  aren't blocked
- Suppress continuation nudges for Q&A conversations (no edit/git tools)
- Capture stderr and verify PID liveness on agent start for proper
  error feedback in UI
- Extract Error: lines from serve.log instead of showing cobra help text
- Add SilenceUsage to run/serve commands to prevent help dump on errors
- Load agent .env and encrypted secrets in skill builder provider check
- Stream chat text to UI in real-time via status/result SSE events
- Show agent start errors in UI card instead of only console.error
@initializ-mk initializ-mk merged commit ede56b1 into main Apr 4, 2026
9 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.

1 participant