feat: k8s-cost-visibility skill, security hardening, and guardrails-by-default#24
Merged
initializ-mk merged 1 commit intomainfrom Mar 6, 2026
Merged
feat: k8s-cost-visibility skill, security hardening, and guardrails-by-default#24initializ-mk merged 1 commit intomainfrom
initializ-mk merged 1 commit intomainfrom
Conversation
…d k8s-cost-visibility skill Security hardening for cli_execute: - Block shell interpreters (bash, sh, zsh, etc.) unconditionally - Add path confinement: reject path args inside $HOME but outside workDir - Override HOME to workDir in subprocess env to prevent ~ expansion escape - Set cmd.Dir to workDir for defense-in-depth Tool output guardrails: - Add CheckToolOutput to GuardrailEngine (enforce: block, warn: redact) - Wire AfterToolExec hook to scan tool output for secrets/PII - Use generic error message to avoid leaking guardrail internals - Enable hooks to modify ToolOutput via mutable HookContext Runtime defaults: - Enable all guardrails by default (--enforce-guardrails=true) - Add --no-guardrails flag to opt out - Add DefaultPolicyScaffold with all 4 built-in guardrails - Add session_max_age config for stale session expiry New skill: - k8s-cost-visibility: estimate K8s infrastructure costs with attribution reports
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kubectl get.bash,sh,zsh, etc.) unconditionally. Validates path arguments — rejects paths inside$HOMEbut outsideworkDir. OverridesHOMEenv toworkDirin subprocesses. Setscmd.DirtoworkDir.AfterToolExechook scans tool output for secrets/PII before it enters the LLM context. Enforce mode blocks with a generic error (no guardrail type leaked). Warn mode redacts matches with[REDACTED].--enforce-guardrailsnow defaults totrue. Added--no-guardrailsflag.DefaultPolicyScaffold()includes all 4 built-in guardrails even withoutforge build.memory.session_max_ageorFORGE_SESSION_MAX_AGE. Stale sessions are discarded to prevent poisoned error context.Security fixes
Addresses social-engineering attack where an agent was tricked via Slack into listing
~/Library/Keychains/, reading the login keychain, and base64-encoding it as a file attachment:bash -c "ls ~/Library/Keychains"ls ~/Library/Keychains/cat ../../.ssh/id_rsa~expansionHOMEoverridden toworkDirin envCheckToolOutputredacts/blocks before LLM context"guardrail no_pii""tool output blocked by content policy"messageTest plan
TestCLIExecute_ShellInterpreterBlocked— all 8 shells rejectedTestValidatePathArg_BlocksHomeTraversal— 13 cases (workDir allowed, system allowed, home traversal blocked)TestLooksLikePath— 14 cases covering paths, flags, plain argsTestCLIExecute_PathTraversalBlocked— integration test withls $HOMETestCLIExecute_HomeOverriddenToWorkDir— verifies subprocess HOME = workDirgo test ./...passes in forge-core and forge-cligolangci-lint runclean in both modules