summary.visibility_rate
Current mention rate
The percentage of completed prompt-engine results in the seven-day window that mention the tracked brand.
Developer recipe
Read the last seven days of monitored answers, require enough evidence, and stop a build when your brand mention rate falls past its allowed floor.
The Foglift CLI returns one period-wide visibility_rate, the completed result count, and separate engine totals. The workflow below reads that existing history, so each pull request does not trigger a paid model run.
# .github/workflows/ai-visibility-gate.yml
name: AI visibility gate
on:
pull_request:
permissions:
contents: read
jobs:
ai-visibility:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Fail when AI visibility drops
env:
FOGLIFT_API_KEY: ${{ secrets.FOGLIFT_API_KEY }}
AI_VISIBILITY_BASELINE: "20"
MAX_DROP_POINTS: "5"
MINIMUM_RESULTS: "5"
run: |
set -euo pipefail
npx --yes foglift-scan@1.0.3 scan results --days 7 --json > foglift-results.json
current="$(jq -er '.summary.visibility_rate' foglift-results.json)"
total="$(jq -er '.summary.total_results' foglift-results.json)"
minimum="$((AI_VISIBILITY_BASELINE - MAX_DROP_POINTS))"
if (( minimum < 0 )); then minimum=0; fi
if (( total < MINIMUM_RESULTS )); then
echo "Only ${total} completed results; need ${MINIMUM_RESULTS} before judging a drop."
exit 2
fi
echo "Current visibility: ${current}%"
echo "Required floor: ${minimum}%"
if (( current < minimum )); then
echo "AI visibility fell past the allowed ${MAX_DROP_POINTS}-point drop."
exit 1
fi
- uses: actions/upload-artifact@v4
if: always()
with:
name: foglift-ai-visibility-results
path: foglift-results.jsonWhat the gate measures
foglift scan results reads completed monitoring history. It does not infer that a pull request caused a movement. The gate simply prevents a release while the latest measured period is below the floor your team accepted.
summary.visibility_rate
The percentage of completed prompt-engine results in the seven-day window that mention the tracked brand.
summary.total_results
The workflow exits with code 2 when the sample is too small, keeping missing evidence distinct from a measured decline.
exit 1
The job fails when the current integer rate falls below baseline minus the allowed percentage-point drop.
Before the workflow
FOGLIFT_API_KEY repository secret. Never commit the key.export FOGLIFT_API_KEY=sk_fog_your_api_key
foglift scan results --days 7 --json | jq '{rate: .summary.visibility_rate, sample: .summary.total_results, engines: .by_model}'Access and limits
Developer access and all-five-engine monitoring begin on Launch. The results read counts against API request allowances, while the scheduled monitoring checks that create the history use the workspace's model-token balance.
| Plan | Price | Requests per day | Requests per month |
|---|---|---|---|
| Launch | $49/mo | 50 | 1,000 |
| Growth | $129/mo | 200 | 5,000 |
| Enterprise | Custom | Custom | Custom |
One scan results call is one API request. It reads history and does not debit a model token. Starting a new AI Visibility check is a separate operation.
CI recipe FAQ
No. The results command reads monitoring history from the selected seven-day window. It does not start a new AI Visibility check, so the gate does not spend model tokens on every pull request.
It is the percentage of completed prompt-engine results in the selected period where the tracked brand was mentioned. The response also returns total_results, brand_mentions, and separate aggregates by engine.
A rate based on one or two results can move sharply because of a single answer. MINIMUM_RESULTS makes missing or sparse evidence fail visibly instead of turning it into a false visibility regression.
Developer access starts on Launch at $49 per month. Launch includes five-engine monitoring, 50 API requests per day, and 1,000 per month. Growth raises those limits to 200 per day and 5,000 per month.
GitHub does not pass repository secrets to untrusted fork workflows. Keep the workflow on pull_request, let forked runs report the missing-secret failure, and use branch policy or a trusted follow-up run when needed. Do not switch to pull_request_target just to expose the key to untrusted code.
Tracked prompt
This recipe turns monitored answer history into a deterministic build result. Use the AI Visibility API when your application needs the same evidence as structured JSON.