This bot helps detect Personally Identifiable Information (PII) in Slack messages. It scans for sensitive data like emails, phone numbers, credit card numbers, IP addresses, passport numbers, and IBANs. This supports compliance with regulations like GDPR.
ChatGPT wrote all the code, configuration files, and this README. The only manual steps were using Git to commit and push the code to GitHub. This project shows how you can use AI to create a simple tool that helps protect sensitive information in your workspace.
- Node.js and npm installed.
- ngrok installed to expose the local server.
- A Slack app with the needed permissions and a bot token.
- Go to Slack API: Your Apps and click "Create New App."
- Choose "From scratch" and name your app.
- Select the workspace where you will install the bot.
- Under "OAuth & Permissions," add these scopes:
chat:write
channels:history
channels:read
im:history
im:read
im:write
- Click "Install to Workspace" to get the OAuth token.
- Under "Event Subscriptions," turn on "Enable Events."
- Set the "Request URL" (you will get this URL from
ngrok
in step 7). - Under "Subscribe to Bot Events," add:
message.channels
message.groups
message.im
- Extract the zip file or clone the repository.
- Open the terminal and navigate to the project directory.
- Create a
.env
file with this content:SLACK_BOT_TOKEN=your-slack-bot-token SLACK_SIGNING_SECRET=your-slack-signing-secret
npm install
npm run start
Open a new terminal and run:
ngrok http 3000
Copy the public URL.
- In Slack's settings, set the "Request URL" to:
https://<your-ngrok-url>/slack/events
- Invite the bot to a channel using
/invite @botname
. - Send a message with PII (like an email). The bot will send a warning if it detects sensitive data.
The bot checks for:
- Credit Card Numbers
- Email Addresses
- Phone Numbers
- IP Addresses
- Passport Numbers
- IBANs
The project includes a GitHub Actions workflow that runs on every push or pull request to the main
branch. The workflow:
- Installs dependencies.
- Lints the code.
- Runs the tests.
ChatGPT also wrote the CI configuration to ensure code quality and functionality.
- Each time you restart
ngrok
, the public URL changes. Update it in Slack's settings. - Keep the
.env
file private.
This bot was created by ChatGPT, from writing code to setting up CI. This shows how AI can quickly build and test tools that protect data in your Slack workspace.