HackyJS CoursesMerge Gates: Hardening a GitHub Org for AI-Written Code

// module 07 · AI agents on developer machines

Permissions, secrets and the sandbox

A deny rule on `Read(./.env)` stops the agent's file tool and `cat .env`. It does not stop `grep -r`, a Python one-liner, or any program that opens the file itself, and it does nothing about the tokens already sitting in the developer's environment. We test each of those in a container, then add the OS-level sandbox (bubblewrap on Linux) with a managed network allowlist and credential rules, and run the same probes again. The result is a policy where the agent can still work, and the secrets on the laptop are out of its reach unless someone with admin rights changes it.

  • Lesson 24 of 34

Learning Objectives

  • Write `Read` deny rules for project secrets and home-directory credentials with the right path syntax
  • Explain which Bash commands a `Read` deny rule catches and which it can't
  • Lock permission rules to managed settings and turn off bypass mode for every developer
  • Enforce the Claude Code sandbox with a managed network allowlist, `denyRead` paths and credential rules
  • Show which environment variables the agent's shell can see, and remove the ones it shouldn't

This lesson is for enrolled learners

Log in, then enroll to read the full lesson, run its lab and take the quiz.