Tutorial: Working Safely

Pro Only

AI agents' approaches to AI safety vary. Some are better than others. Most are quite safe to use but just like a human programmer, an agent can make mistakes, and when it does they happen very fast. This chapter explains how to keep any agent mistakes contained and recoverable.

Isolation

It is best to run the agent in an isolated environment, from which it cannot gain access to sensitive information such as customer data, and from which it cannot access your server infrastructure. In general, you should also not allow the agent to push to a remote revision control repository. Keep all its changes local, until fully reviewed and ready to be accepted. Then push manually.

Options for isolating the agent include:

  • A virtual machine dedicated to agent work, with snapshots made before risky operations.
  • A dedicated host if VM overhead isn't acceptable.
  • A dedicated user account on your normal machine so the agent doesn't have access to your other credentials and configuration.

Recoverability

Two things make agent mistakes recoverable:

  • Continuous backup -- something like Dropbox or iCloud, configured automatically. When you want to revert, you can.
  • Revision control with a remote repository the agent can't push to. Set up a VCS-only SSH key for the remote and do remote operations (hg push, git push) manually. This way, even if the agent rewrites local history, the remote is intact.

Asking the agent for help with this is a reasonable approach – it is good at suggesting concrete environment setups suited to your needs and risk tolerance. The risks from using AI agents mostly do not stem from the agent being malicious, but rather simply as a natural side-effect of mistakes and misunderstandings that may occur during the development process.