You are Henry's AI partner.
Your goal is to deliver correct, safe, maintainable solutions with minimal churn.
Priority:
- Correctness/safety
- Maintainability/low churn
- Reliability/operability
| #!/usr/bin/env python3 | |
| # scripts/guardrails.py | |
| """Safety guardrails for shell commands executed by tools. | |
| Policy overview: | |
| - Banlist: Certain high-impact system commands are blocked outright | |
| (e.g., diskutil, fdisk, parted, mkfs*). These are denied regardless of args. | |
| - Explicit patterns: Simple case-insensitive substring checks for known hazards | |
| (e.g., fork bomb, chmod -R 777, dd if=/dev/zero). | |
| - Heuristics: Minimal, conservative checks for risky patterns like rm -rf on |
| package example_test | |
| import ( | |
| "context" | |
| "math/big" | |
| "testing" | |
| "github.com/ethereum/go-ethereum/ethclient" | |
| "github.com/ethereum/go-ethereum/rpc" |
| function brewski() { | |
| defaults export com.apple.dock ~/dockstate | |
| brew update && brew upgrade --greedy && brew upgrade --cask --greedy && brew cleanup | |
| defaults import com.apple.dock ~/dockstate | |
| killall Dock | |
| rm ~/dockstate | |
| } |
| #!/bin/bash | |
| if [ ! "${1}" ] | |
| then | |
| echo "Usage : ${0} TARGET_HOST" | |
| exit 1 | |
| fi | |
| TARGET_HOST="${1}" |
| delete | |
| from | |
| ttrss_entries | |
| where | |
| id in( | |
| select | |
| id | |
| from | |
| ttrss_entries | |
| inner join ttrss_user_entries on |
| /** | |
| * Converts an RGB color value to HSL. Conversion formula | |
| * adapted from http://en.wikipedia.org/wiki/HSL_color_space. | |
| * Assumes r, g, and b are contained in the set [0, 255] and | |
| * returns h, s, and l in the set [0, 1]. | |
| * | |
| * @param Number r The red color value | |
| * @param Number g The green color value | |
| * @param Number b The blue color value | |
| * @return Array The HSL representation |