GitHub App Engine
Repository posture signals and pull-request changed-file analysis — free with the GitHub App. Connect a repository to a HAIEC AI System for full remote evidence-bound Assurance.
Coverage Levels
Posture and changed-file analysis run automatically on supported PR events. Whole-repository analysis is a separate, explicitly initiated Assurance run — not a per-PR mode.
Repository Posture
Repository configuration signals only. No file contents accessed.
- SECURITY.md, CODEOWNERS, LICENSE detection
- Branch protection rules
- CI/CD workflow presence
- Dependabot configuration
- Trust artifact generation
Included free with the GitHub App — fair-use limits apply
PR Changed-File Analysis
Scans only the files changed in a pull request using HAIEC's AI/AppSec rules.
- Everything in Metadata mode
- Inline PR review comments
- Prompt injection detection
- PII exposure detection
- Access control gap analysis
Changed files only — PR_CHANGED_FILES != full-repository Assurance
Full Remote Assurance
Deep scan of the entire repository through the canonical Assurance pipeline — explicitly initiated, not a per-PR mode.
- Requires a verified Source Asset bound to an AI System
- Canonical Assurance Evaluation (ALLOW / REVIEW / BLOCK)
- Report, Passport, and Dashboard history
- Trigger from dashboard, Assurance API, or IDE
- Server-side GitHub App authorization — no caller token
See the Connected GitHub guide
Repository Posture Details
The free metadata mode collects repository configuration signals to assess governance readiness.
File Presence Detection
- -SECURITY.md
- -CODEOWNERS
- -LICENSE
- -CHANGELOG.md
- -README.md
Branch Protection Rules
- -Required reviews
- -Status checks
- -Signed commits
- -Force push restrictions
CI Workflow Detection
- -.github/workflows/ presence
- -Workflow file count
- -No parsing or execution
Repository Settings
- -Dependabot config
- -Commit activity
- -Vulnerability alerts enabled
AI Code Security Analysis
When changed-file analysis is enabled, HAIEC runs its AI/ML-specific security rules against the files changed in each PR.
Prompt Injection Detection
Identifies user-controlled inputs that flow into LLM prompts without sanitization.
Access Control Gaps
Detects AI endpoints missing authentication, rate limiting, or authorization checks.
PII Exposure
Finds personal data flowing into AI model inputs, logs, or external APIs.
Unsafe API Patterns
Catches hardcoded API keys, unvalidated model outputs, and insecure configurations.
How Inline Comments Work
How It Works
GitHub App Installation
Install the HAIEC GitHub App from GitHub Marketplace. Posture signals are free. Enable changed-file analysis in your HAIEC dashboard; connect the repository to an AI System for full remote Assurance.
Webhook Registration
GitHub automatically sends webhooks to HAIEC when PRs are opened or synchronized. No polling, no continuous monitoring.
Metadata Collection
HAIEC queries GitHub API for repository metadata: file presence, branch protection rules, workflow file count, Dependabot config.
AI Code Analysis (changed files)
If enabled, HAIEC fetches changed files and runs its AI security rules. Findings are posted as inline PR review comments with severity and remediation.
PR Comment
HAIEC posts a PR comment with control signal breakdown, readiness score, and (if enabled) a security findings summary section.
Badge Generation
A "HAIEC Control Signals" badge is generated with status: Controls Present, Controls Partial, or No Controls Detected.
Trigger Paths
| Trigger | Automatic? | Coverage |
|---|---|---|
| PR opened | YES (webhook) | Posture + changed-file analysis (if enabled) |
| PR synchronize (new commits) | YES (webhook) | Posture + changed-file analysis (if enabled) |
| Manual API call | NO (user-initiated) | Metadata only |
GitHub App vs. Full Assurance
PR protection is free with the GitHub App. Full Assurance requires connecting the repository to a HAIEC AI System — and produces a different kind of result.
| Capability | GitHub App (Free) | Full Assurance |
|---|---|---|
| Repository posture signals | Yes | Included as evidence |
| PR changed-file analysis | Yes | Covered by full scan |
| Whole-repository remote scan | - | Yes — explicitly initiated |
| Canonical Evaluation (ALLOW/REVIEW/BLOCK) | - | Yes |
| Report / Passport / Dashboard | - | Yes |
| Requires HAIEC API key (external calls) | No | Yes — dashboard sessions exempt |
Internal fair-use limits apply to automated PR analysis. GOVERNANCE_SIGNAL != SECURITY_FINDING and PR_CHANGED_FILES != FULL_REPOSITORY_ASSURANCE.
Badge Output
The GitHub App produces a "HAIEC Control Signals" badge with the following statuses.
Most governance controls detected
Some controls detected, gaps exist
Minimal or no governance controls
GitHub App not installed
Initial scan in progress
Engine Overview
The HAIEC GitHub App Engine is a deterministic, rule-based compliance and security scanner that integrates directly into your GitHub workflow via webhooks.
Architecture
- Webhook-driven — triggered by GitHub PR events, no polling
- Reproducible for the same inputs — same input produces same output, no AI/ML inference
- AST-based analysis — parses code into Abstract Syntax Trees for pattern matching
- Read-only — never modifies your code, settings, or repository
Engine Components
- Evidence Collector — queries GitHub API for 10 governance control signals
- Static Analyzer — 92 core rules + 45 AI-Assisted Dev rules (AIC-R prefix)
- Readiness Calculator — scores governance posture from 0-100%
- Artifact Generator — produces cryptographically-hashed trust artifacts
Supported Technologies
The engine supports the following languages, frameworks, and AI providers for static analysis.
Languages
.ts / .tsx.js / .jsx.mjs / .cjs.pyAdditional language coverage (including Go) is available in full remote Assurance scans.
Frameworks
Framework detection is automatic based on imports and file patterns.
AI Providers Detected
The engine detects AI SDK imports and API calls to these providers.
Prerequisites
Required
- GitHub account — personal or organization
- Admin access — to the GitHub organization or repository where you want to install
- HAIEC account — sign up at haiec.com (free tier available)
- GitHub OAuth link — connect your GitHub account to HAIEC via OAuth so installations appear in your dashboard
Not Required
- No CI/CD pipeline changes needed
- No configuration files to add to your repo
- No code changes or SDK installation
- No programming knowledge (for metadata mode)
- No secrets, tokens, or API keys to configure
Repository Structure
The engine automatically detects governance controls and scans code regardless of your repo layout. Here is what it looks for.
Governance Files Detected (Metadata Mode)
SECURITY.mdSecurity vulnerability disclosure policy.github/CODEOWNERSCode ownership and review requirementsLICENSEOpen source license declarationCHANGELOG.mdChange tracking and release notesREADME.mdProject documentation and overview.github/dependabot.ymlAutomated dependency updates.github/workflows/*.ymlCI/CD pipeline definitionsCode Scan Targets (Diff / Full Mode)
Scanned
.ts, .tsx, .js, .jsx, .py, .mjs, .cjs- Source files in any directory structure
- Configuration files (.yaml, .yml, .json, .tf)
- Dockerfiles
Excluded
node_modules/,.git/,.next/dist/,build/,coverage/__pycache__/,.venv/,venv/- Binary files, generated files, vendor directories
Monorepo & Multi-Repo Support
Monorepo (Multiple Products, One Repo)
If your repository contains multiple products or services in subdirectories:
- Metadata mode — governance files are detected at the repo root. Place SECURITY.md, CODEOWNERS, etc. at the root level.
- Diff mode — only changed files in the PR are scanned, regardless of which subdirectory they are in. Each PR gets its own analysis.
- Full Assurance — whole-repository analysis runs through an explicitly initiated remote Assurance run on a verified Source Asset; findings are organized by file path.
Tip: Install the app on the monorepo once. All PRs across all subdirectories will be analyzed. The readiness score reflects the entire repo's governance posture.
Multi-Repo (Same Product, Multiple Repos)
If your product is split across multiple repositories (e.g., frontend, backend, infra):
- Install on all repos — select "All repositories" during installation, or add each repo individually.
- Independent scoring — each repo gets its own readiness score and trust artifact. This is by design: each repo has its own governance posture.
- Dashboard aggregation — your HAIEC dashboard shows all installations. You can compare readiness scores across repos.
Tip: Each repo should have its own SECURITY.md, CODEOWNERS, and branch protection rules. Governance controls are assessed per-repo.
Security & Data Flow
Your code is never stored. Here is exactly what happens at each stage.
No Repository Storage Guarantee
- Source code is never persisted — code is read via GitHub API, analyzed in memory, and discarded after the scan completes.
- No cloning in diff mode — changed files are fetched individually via GitHub API, not cloned.
- Full Assurance uses ephemeral remote execution — repository content is analyzed in short-lived infrastructure using scoped GitHub App installation credentials.
- Only findings are stored — rule ID, file path, line number, severity, and remediation text. Never the source code itself.
Data Flow by Scan Mode
Metadata Mode
Data accessed: repository settings, file existence checks, branch protection rules. No file contents read.
Diff Mode
Data accessed: changed file contents (temporary, in-memory only). Stored: finding metadata only (rule ID, path, line, severity).
Full Remote Assurance (separate flow)
Data accessed: the authorized repository, server-side, using short-lived installation credentials that are never returned to callers. Stored: findings, evidence metadata, and evaluation records — not a repository copy.
Permissions Summary
| Permission | Access Level | Purpose |
|---|---|---|
| Contents | Read | Read file contents for diff/full scan |
| Metadata | Read | Repository settings, branch protection |
| Pull Requests | Read + Write | Post PR comments and inline review comments |
| Code (write) | NOT requested | HAIEC never pushes commits or modifies code |
| Secrets | NOT requested | HAIEC never accesses environment variables or secrets |
Generating Artifacts & Evidence
Trust artifacts are generated automatically on every PR scan. They serve as cryptographically-verifiable evidence of your governance posture.
How Artifacts Are Generated
PR Triggers Scan
When a PR is opened or updated, the webhook triggers the evidence collection pipeline.
Evidence Collected
The engine queries GitHub API for 10 governance control signals (file presence, branch protection, CI, etc.).
Readiness Score Calculated
A deterministic score (0-100%) is computed based on which controls are present and their weights.
Trust Artifact Created
A cryptographically-hashed artifact is generated containing: evidence items, readiness score, timestamp, engine version, and a SHA-256 content hash.
Badge Generated
A visual badge (Controls Present / Partial / None) is created and can be embedded in your README.
Where to Find Artifacts
PR Comments
Every PR receives a comment with the readiness score breakdown and a link to the full artifact.
HAIEC Dashboard
Go to Dashboard → GitHub to see all installations, readiness scores, and downloadable artifacts.
Badge Embed
Copy the badge URL from your dashboard and add it to your README.md for public visibility.
How to Read Artifacts & Reports
Readiness Score (0-100%)
The readiness score reflects how many governance controls are present in your repository. It is NOT a security score — it measures governance posture.
Most governance controls detected. Strong posture.
Some controls present, gaps exist. Review missing items.
Minimal governance controls. Immediate action recommended.
Security Findings (changed-file analysis)
Each finding includes the following fields:
| Field | Description | Example |
|---|---|---|
| Rule ID | Unique rule identifier | AIC-R015 |
| Severity | Critical / High / Medium / Low | Critical |
| File | File path where the finding was detected | src/api/handler.ts |
| Line | Exact line number | 42 |
| Description | What was detected and why it matters | Route without authentication middleware |
| Remediation | Specific fix recommendation | Add auth middleware to this route handler |
| CWE | Common Weakness Enumeration mapping | CWE-306 |
Trust Artifact Fields
Each trust artifact contains the following verifiable data:
Artifact ID
Unique, immutable identifier for this artifact
Timestamp
UTC timestamp when the artifact was generated
Engine Version
Version of the HAIEC engine that produced this artifact
Content Hash
SHA-256 hash of the artifact contents for tamper detection
Readiness Score
Governance readiness percentage (0-100%)
Evidence Items
List of 10 control signals with pass/fail status
Ready to Connect Your Repository?
Install the HAIEC GitHub App to start collecting control signals and PR findings. Connect a repository to an AI System for full remote Assurance.