feat: add allowed_commands support to profile security config#204
Conversation
Closes always-further#158 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Joseph Gimenez <joseph.gimenez@joingotu.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the security configuration for profiles by introducing a mechanism to explicitly allow specific commands. This provides greater flexibility for users to define exceptions to default security policies within their profiles, allowing certain commands to execute that would otherwise be blocked, while still respecting CLI overrides. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces allowed_commands to security profiles, enabling fine-grained control over command execution policies. The implementation is solid, touching the necessary parts from configuration to capability building. The added tests are thorough, covering both deserialization and the end-to-end logic. I have one suggestion for a minor performance and idiomatic improvement.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Joseph Gimenez <joseph.gimenez@joingotu.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Joseph Gimenez <joseph.gimenez@joingotu.com>
Signed-off-by: Luke Hinds <lukehinds@gmail.com>
Summary
allowed_commandsfield toSecurityConfigso profiles can allowlist commands that are blocked by default policyallowed_commandsintofrom_profile()capability building, applied before CLI--allow-commandoverridesallowed_commandsfromProfileDefin built-in profile conversionCloses #158
Changes
crates/nono-cli/src/profile/mod.rsallowed_commands: Vec<String>toSecurityConfigwith#[serde(default)]crates/nono-cli/src/capability_ext.rsprofile.security.allowed_commandsviacaps.add_allowed_command()before CLI overridescrates/nono-cli/src/policy.rsallowed_commandsinProfileDef::to_profile()CHANGELOG.mdREADME.mdallowed_commandsto Destructive Command Blocking sectioncrates/nono-cli/README.mddocs/cli/usage/flags.mdxallowed_commandsprofile config example to Command Blocking docsUsage
{ "meta": { "name": "rm-test" }, "filesystem": { "allow": ["/tmp"] }, "security": { "allowed_commands": ["rm"] } }nono run --profile rm-test -- rm /tmp/hello.py # rm is no longer blockedTest plan
make clippy— cleanmake fmt-check— cleanmake test-cli— 286 passedtest_security_config_allowed_commands_deserializes— verifies JSON deserializationtest_security_config_allowed_commands_defaults_empty— verifies empty defaulttest_from_profile_allowed_commands— verifies end-to-end wiring into CapabilitySetManual smoke tests (macOS)
allowed_commands: ["rm"]+ dry-runrmwithout profile (noallowed_commands)rmwith profileallowed_commands: ["rm"](live)allowed_commands: ["rm", "chmod"]— runchmodallowed_commandsfield — runrm🤖 Generated with Claude Code