fix(security): allow bare date in default autonomy policy#2534
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe PR enables the ChangesEnable date command with argument restrictions
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Current red/cancelled checks are CI infrastructure, not the security-policy change. Observed failures:
The shared CI fix is #2535, now green on |
7bde67b to
3c91e85
Compare
3c91e85 to
f6adc29
Compare
|
CI status note — the two remaining red checks are infrastructure flakes, not test failures from this PR:
All substantive checks are green: Rust Core Tests + Quality, TypeScript, Frontend Unit Tests, Rust Quality (fmt + clippy), Coverage Matrix Sync, etc. A re-run should clear these. |
Summary
datecommand.dateargument handling conservative:date 2026-05-21remains blocked by command argument safety checks.shell date.Problem
SecurityPolicyallowlist already includeddate, and the agent harness instructions tell the assistant to useshellwithdatefor date/time questions.AutonomyConfig::default()did not includedate, so runtime policies created from default config could reject that basic read-only workflow.Solution
datetodefault_allowed_commands()in the autonomy config schema.dateto no arguments inSecurityPolicy::is_args_safe()so allowing baredatedoes not also allow date-setting style arguments.date.Submission Checklist
diff-cover) meet the gate enforced by.github/workflows/coverage.yml. CI will enforce the merged coverage gate for this Rust-only change.docs/TEST-COVERAGE-MATRIX.mdreflect this change. N/A: behavior-only security policy parity fix, no feature row added/removed/renamed.## Related. N/A: no coverage-matrix feature ID changed.docs/RELEASE-MANUAL-SMOKE.md). N/A: no release smoke surface changed.Closes #NNNin the## Relatedsection. N/A: OpenHuman 不执行命令和无反馈的分析 #2486 has broader remaining scope; this PR references but does not close it.Impact
datebecomes allowed under default config-derived policies.datewith arguments remains blocked to avoid widening command execution to system-time mutation forms.Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
fix/2486-allow-date-default43777cd7Validation Run
pnpm --filter openhuman-app format:check— N/A: no frontend files changed.pnpm typecheck— N/A: no TypeScript files changed.GGML_NATIVE=OFF cargo test --manifest-path Cargo.toml config_default_policy_allows_prompt_date_command --lib;GGML_NATIVE=OFF cargo test --manifest-path Cargo.toml openhuman::security::policy::tests --libcargo fmt --manifest-path Cargo.toml --all --check;git diff --check;GGML_NATIVE=OFF cargo check --manifest-path Cargo.tomlValidation Blocked
command:N/Aerror:N/Aimpact:N/ABehavior Changes
datecommand used by agent instructions.Parity Contract
SecurityPolicyalready allowed baredate; config-derived policy now matches it.date 2026-05-21remains blocked by argument safety tests.Duplicate / Superseded PR Handling
Summary by CodeRabbit
New Features
datecommand is now available by default in autonomy configurations.Bug Fixes
datecommand is now restricted to execute without additional arguments for enhanced security enforcement.Tests
datecommand policy behavior.