An AI-powered network troubleshooting assistant that combines GPT-4's analytical capabilities with automated network device interaction.
AI TAC is a Go-based CLI tool that simulates a network TAC engineer by automatically executing diagnostic commands and analyzing their output. It uses GPT-4 to determine appropriate troubleshooting steps while maintaining strict safety measures to prevent any harmful commands from being executed.
- 🔒 Safe command execution with built-in protections
- 🤖 AI-powered troubleshooting flow
- 📝 Automated command execution on network devices
- 💾 Persistent troubleshooting history
- ✨ Formatted markdown output for results
- Go 1.x or higher
- OpenAI API key
- Network devices running Cisco IOS-XR
- Required Go packages (see Dependencies section)
- Clone the repository:
git clone https://www.github.com/metajar/ai-tac
cd ai-tac
- Install dependencies:
go mod download
- Set up your OpenAI API key:
export OPENAI_API_KEY='your-api-key-here'
Run the program with the following flags:
go run cmd/cli/main.go -question "What is your troubleshooting question?" -host "device-ip-or-hostname"
go run cmd/cli/main.go -question "Why is interface GigabitEthernet0/0/0/0 down?" -host "192.168.1.1"
You can build the TUI by running:
go build -o ./ai-tac ./cmd/tui
You can then run the ai-tac binary and have fun.
- You provide a troubleshooting question and target device
- GPT-4 suggests appropriate diagnostic commands
- Commands are automatically executed on the target device
- Results are analyzed by GPT-4
- Process continues until the issue is identified or more information is needed
- Final analysis is presented in formatted markdown
- github.com/charmbracelet/glamour - For markdown rendering
- github.com/openai/openai-go - OpenAI API client
- github.com/scrapli/scrapligo - Network device automation
- Standard Go libraries
- Strict command filtering to prevent configuration changes
- No debug commands allowed
- Prevention of resource-intensive operations
- Authentication handling with proper credential management
The CLI tool currently uses hardcoded credentials for device access:
- Username: clab
- Password: clab@123
For production use, you should modify these to use environment variables or a secure configuration file.
The TUI has a prompt at the beginning of the troubleshooting session to set these.
- Currently supports only Cisco IOS-XR devices
- Requires direct network access to devices
- Depends on GPT-4 API availability
- Not intended for production troubleshooting
Contributions are welcome! Some areas that could use improvement:
- Multi-vendor support
- Secure credentials management
- Command template library
- Result caching and optimization
- Test coverage
- Support for additional network vendors
- Integration with existing monitoring systems
- Custom command template support
- Result database for knowledge building
- Enhanced security features
This tool is for educational and development purposes only. It should not be used as a replacement for professional network troubleshooting in production environments.
Srsly? There is none