Never commit your Slack token or channel ID to source code or GitHub. Store secrets in environment variables or a .env
file (add .env
to .gitignore
).
Portia Oncall Agent automates log triage for oncall engineers. It reads logs, detects errors, suggests fixes, and notifies the team via Slack, with human approval for all automated actions. All actions are logged for auditability and compliance.
- Modular architecture: log reading, error parsing, suggestion generation, notification, approval, and audit are separate modules.
- Regex/keyword-based error detection for reliability and extensibility.
- Actionable suggestions mapped to detected errors.
- Slack integration for real-time notifications (coming soon).
- Human-in-the-loop approval for safety.
- Persistent audit logging of all actions.
- Clone the repository.
- Install Python 3.7+.
- Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # or source venv/bin/activate.fish for fish shell
- Install required packages:
pip install slack_sdk
- Set environment variables as needed (see
config/README.md
). - Place sample log files in
sample_logs/
. - Run the agent:
python3 main.py
- The agent reads a sample log file and detects errors.
- Actionable suggestions are generated for each error.
- A notification is printed (and will be sent to Slack in future versions).
- Human approval is requested interactively.
- All actions are logged to
audit.log
for traceability.
This agent saves engineers from unnecessary night-time disruptions, ensures safety by requiring human approval, and provides a fully auditable workflow. It is designed for real-world impact and extensibility.
For architecture details, see architecture.md
. For configuration, see config/README.md
.