{"slug": "devsecops-ai-workflow-prompt", "title": "DevSecOps AI Workflow Prompt", "summary": "A developer has outlined a workflow that automates AI-powered security analysis on GitHub pull requests, posting summarized reports as comments. The process fetches changed files, scans for vulnerabilities like hardcoded secrets and injection flaws, and generates a Markdown report with severity ratings and recommendations. The workflow emphasizes secure handling of GitHub tokens and idempotent comment posting.", "body_md": "Goal: Build an automated AI workflow that performs security analysis on every GitHub Pull Request and posts a summarized report back as a PR comment.\n\nWorkflow Steps:\n\n```\nSetup Trigger:\n\nConfigure GitHub Pull Request trigger\n\nEvents:\n    opened\n    synchronize\n    reopened\n\nEnsure webhook is registered with the repository\n\nExtract PR Data:\nFrom webhook payload:\n\nRepository owner\nRepository name\nPull Request number\n\nFetch Changed Files:\n\nUse GitHub API:\nGET /repos/{owner}/{repo}/pulls/{pull_number}/files\n\nAuthentication:\n    Retrieve GitHub PAT securely from workspace secrets\n    Example: GITHUB_TOKEN\n\nFor each file:\n    Filename\n    Patch (diff)\n    Status (added/modified/removed)\n\nSkip:\n    Binary files\n    Files exceeding size threshold\n\nAI Security Analysis:\nAnalyze each changed file for:\n\nHardcoded secrets (API keys, tokens, credentials)\nInjection vulnerabilities (SQL, command, etc.)\nUnsafe deserialization\nAuthentication/authorization flaws\nSensitive data leaks\nOWASP Top 10 risks\n```\n\nFor each issue, produce:\n\n```\nSeverity (Low / Medium / High / Critical)\nDescription\nAffected snippet (from diff)\nRecommended fix\n\nAggregate Results:\n\nTotal issues by severity\nFile-wise breakdown\nHighlight critical/high issues\n\nGenerate PR Comment (Markdown):\n```\n\n🔐 AI Security Scan Report\n\nSummary:\n\n```\nCritical: X\nHigh: X\nMedium: X\nLow: X\n```\n\nFindings:\n\n```\nFile: <filename>\n    Issue: <description>\n    Severity: <level>\n    Recommendation: <fix>\n```\n\nOverall Recommendation:\n\n```\n✅ Approve\n⚠️ Needs Fixes\n❌ Block Merge\n\nPost Comment to PR:\n\nGitHub API:\nPOST /repos/{owner}/{repo}/issues/{pull_number}/comments\n\nAuthentication:\n    Use GitHub PAT from workspace secrets (GITHUB_TOKEN)\n    Do NOT hardcode or expose the token\n```\n\nConstraints:\n\n```\nNever expose secrets in logs or outputs\nEnsure idempotency (avoid duplicate comments)\nHandle large PRs efficiently\nRespect API rate limits\n```\n\nOutput: \"Security scan completed and comment posted successfully.\"", "url": "https://wpnews.pro/news/devsecops-ai-workflow-prompt", "canonical_source": "https://gist.github.com/srujanpadala/1dd48b690177d87659b9c0bbb0769e13", "published_at": "2026-08-11 11:21:20+00:00", "updated_at": "2026-08-11 11:39:21.447713+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-products"], "entities": ["GitHub"], "alternates": {"html": "https://wpnews.pro/news/devsecops-ai-workflow-prompt", "markdown": "https://wpnews.pro/news/devsecops-ai-workflow-prompt.md", "text": "https://wpnews.pro/news/devsecops-ai-workflow-prompt.txt", "jsonld": "https://wpnews.pro/news/devsecops-ai-workflow-prompt.jsonld"}}