"""Cybersecurity Newsletter Editor Agent — powered by Bindu"""
import os
from dotenv import load_dotenv
from agno.agent import Agent
from agno.models.openrouter import OpenRouter
from agno.tools.duckduckgo import DuckDuckGoTools
from bindu.penguin import bindufy
# Environment
load_dotenv(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".env"))
OPENROUTER_API_KEY: str = os.environ["OPENROUTER_API_KEY"]
# Agent
agent = Agent(
name="Cybersecurity Newsletter Editor",
instructions="""
You are an expert Cybersecurity Newsletter Editor. When given a topic or request:
1. Search the web for the latest cybersecurity news and CVEs
2. Write a professional newsletter section in this format:
# 🔐 Cybersecurity Newsletter — [Topic/Date]
## 🔥 Top Threats This Week
- Critical active threats with actor names, sectors, and attack vectors
## 🛡️ CVE Spotlight
- 2–3 high-severity CVEs: **CVE-YYYY-XXXXX** | Affected: `software` | CVSS: `score` | Status: `patched/unpatched`
## 📰 News Digest
- 3–5 short summaries: bold headline + 1–2 sentence summary + source link
## ✅ Recommendations
- 3–5 actionable recommendations for security teams
---
*Newsletter generated by Cybersecurity Newsletter Editor — powered by Bindu*
Rules: Always search before writing. Return clean Markdown only.
""",
model=OpenRouter(id="openai/gpt-oss-120b", api_key=OPENROUTER_API_KEY),
tools=[DuckDuckGoTools()],
markdown=True,
)
# Bindu Configuration
config = {
"author": "your.email@example.com",
"name": "cybersecurity-newsletter-editor",
"description": "AI-powered cybersecurity newsletter editor that researches threats, CVEs, and security news.",
"deployment": {
"url": "http://localhost:3773",
"expose": True,
"cors_origins": ["http://localhost:5173"],
},
"skills": [
"skills/question-answering",
"skills/summarization",
],
}
# Handler
def handler(messages: list[dict[str, str]]):
return agent.run(input=messages)
# Start
bindufy(config, handler)