benjaminpalko/.opencode/plugins/env-protection.js
2026-08-11 15:34:48 -04:00

9 lines
284 B
JavaScript

export const EnvProtection = async ({ project, client, $, directory, worktree }) => {
return {
'tool.execute.before': async (input, output) => {
if (input.tool === 'read' && output.args.filePath.includes('.env')) {
throw new Error('Do not read .env files');
}
}
};
};