Apologies if I'm misunderstanding as I only skimmed the source code but..
Why are you sending the full file contents from the agent to the client?
https://github.com/appcanary/agent/blob/master/agent/agent.g...
agent.client.SendFile(file.Path, file.Kind, contents)
Extremely insecure design with a ton of unnecessary overhead. What if those files are configuration files with sensitive data embedded?