Skip to main content
AI agent that researches threats and generates security newsletters.

Code

"""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)

How It Works

Newsletter Structure
  • Top Threats This Week: Critical active threats with actor details
  • CVE Spotlight: High-severity vulnerabilities with CVSS scores
  • News Digest: 3-5 summarized security news items
  • Recommendations: Actionable security team guidance
Research Process
  • DuckDuckGoTools(): Searches for latest cybersecurity news
  • Web research before content generation
  • Source verification and link inclusion
Content Generation
  • Professional newsletter formatting with Markdown
  • Structured sections with emoji headers
  • CVE details in standardized format
  • Clean, publication-ready output
Agent Capabilities
  • Expert Cybersecurity Editor persona
  • Proactive threat intelligence gathering
  • Automated newsletter composition
  • Consistent formatting and style

Run

uv run examples/specialized/cybersecurity-newsletter-editor.py
Try: “Generate this week’s cybersecurity newsletter focusing on ransomware threats” Go to frontend and run npm run dev Open http://localhost:5173 and try to chat with the cybersecurity newsletter editor