안전한 Hermes 설정에는 tool scope, credential 저장, filesystem 변경의 recovery boundary가 각각 필요합니다. 셋 중 하나로 나머지를 대신하면 빈틈이 남습니다.
- Platform마다 필요한 toolset만 활성화합니다.
- 일반 설정은
config.yaml, credential은.env또는 지원되는 credential store에 둡니다. - Secret redaction은 켜 둡니다.
- Rollback이 필요한 작업에서 checkpoint를 활성화한 뒤 복원 전에 diff를 확인합니다.
1. Tool scope부터 줄이기
연동을 추가하기 전에 CLI platform에서 실제로 사용할 수 있는 tool을 확인합니다. Local CLI에는 알맞은 tool이 public messaging channel에서는 지나친 권한일 수 있으므로 platform별 구성이 중요합니다.
hermes tools list --platform cli
hermes tools --summary
모든 toolset을 한꺼번에 켜지 말고 hermes tools enable과 hermes tools disable을 목적에 맞게 사용합니다. Tool 선택은 model이 호출할 수 있는 범위를 줄이지만 shell command approval을 대신하지 않습니다.
2. Approval 유지
Smart approval mode는 저위험 shell command를 자동 승인하고 고위험 command는 거부합니다. 판정이 불확실할 때는 묻습니다. Manual mode는 모든 command에서 확인합니다. Approval을 끄거나 --yolo로 실행하면 이 boundary가 사라집니다.
hermes config set approvals.mode smart
hermes config get approvals.mode
File-writing tool과 shell approval은 다른 장치입니다. Approval이 켜져 있어도 제안된 작업을 검토하고 변경 사항은 version control에 남깁니다.
3. 설정과 secret 분리
일반 설정은 YAML을 직접 고치는 대신 CLI configuration command로 바꿉니다. 두 파일의 내용을 출력하지 않고 active path만 확인할 수 있습니다.
hermes config path
hermes config env-path
hermes config set security.redact_secrets true
API key, token, password, credential material은 .env, OAuth storage, external secret source에 둡니다. Secret redaction은 tool output과 log를 검사합니다. 그렇다고 이를 믿고 secret을 출력해서는 안 됩니다. 마지막 방어선으로 남겨 두는 편이 안전합니다.
4. 되돌릴 작업에 checkpoint 활성화
Checkpoint는 opt-in입니다. 한 chat에서만 켜거나 profile 설정으로 활성화합니다. Checkpoint manager는 shadow Git store에 snapshot을 만들며 project의 .git history는 수정하지 않습니다.
hermes chat --checkpoints
hermes config set checkpoints.enabled true
hermes checkpoints status
활성화된 chat에서 /rollback은 snapshot 목록을 보여 줍니다. 복원 전에 diff를 먼저 봅니다. 일반 restore는 현재 byte가 Hermes의 마지막 write와 같다고 증명할 수 없으면 이후의 수동 편집을 보존합니다. --all은 이를 덮어쓰는 명시적인 destructive form입니다.
/rollback
/rollback diff <N>
/rollback <N>
/rollback <N> --all
Checkpoint는 commit, branch, backup, review를 대체하지 않습니다. 큰 file과 지나치게 넓은 directory는 제외될 수 있으며 store에는 retention과 size limit이 있습니다.
5. Secret-safe 감사기 실행
이 편의 fixture는 configuration text를 읽지만 .env를 열지 않습니다. Secret file이 존재하는지, permission bit가 private인지 확인하고 setting 상태와 이름만 보고합니다.
HERMES_HOME="$PWD/examples/chapter-03-security-checkpoints/fixtures/safe-home" python3 examples/chapter-03-security-checkpoints/safety_audit.py --json
python3 -m unittest discover -s examples/chapter-03-security-checkpoints/tests -v
{"status":"PASS","config_present":true,"secret_file_present":false,"secret_file_private":false,"approvals_mode":"smart","redaction_enabled":true,"checkpoints_enabled":true}
Fixture는 config.yaml의 credential 성격 이름과 지나치게 넓은 .env permission도 거부합니다. 문제가 된 값은 다시 출력하지 않습니다.
6. Recovery layer 조합
실용적인 boundary는 여러 겹입니다. 좁은 tool은 가능한 action을 줄입니다. Approval은 위험한 shell command를 막습니다. Secret 배치와 redaction은 노출을 줄이고 checkpoint는 선택적 rollback을 지원합니다. Git은 의도한 history를 기록하고 backup은 checkpoint store 바깥의 실패까지 다룹니다.
처음에는 capability를 좁게 잡습니다. 구체적인 task에 필요할 때만 tool이나 bypass를 추가합니다. 일이 끝나면 예외를 제거합니다.
답글 남기기