curl and jq (command-line HTTP client and JSON parser), access to the machine or container where the agent runs, and write access to its environment variables or secret store.
curl calls in PowerShell 7+ or WSL. On older PowerShell, curl is an alias for Invoke-WebRequest, so call curl.exe explicitly.curl (any current build) and jq (JSON filter). Install with sudo apt install curl jq or brew install curl jq. Verify with jq --version — it must print a version string.revoke-audit.txt with one line per app, token and permission.Two terms used below. Access token — a long string that proves "this program is allowed to act for this account"; whoever holds it, can post. Graph API — Meta's HTTP interface for reading and writing Facebook data; every agent call goes through it.
Before anything else, map what is holding a token. Most leaks are not in Facebook at all:
| Where the token lives | Typical symptom | Where to look | |
|---|---|---|---|
| Shell `export` / `.env` file | Survives reboot of your laptop | `grep -r "access_token" ~/.env ./agent` | |
| Container environment | Old value after you rotated | `docker inspect <container> \ | grep -i token` |
| Secret manager entry | Agent reads stale version | your vault's version history | |
| Agent config (tools list) | Tool still enabled after revoke | the agent's tool/permission file | |
| Notebook / script copy | Forgotten one-off run | `grep -rl "EAA" ~/projects` |
What to do: list all apps with access to the account, then ask the Graph API which permissions the agent's token actually carries.
Why: you cannot revoke what you have not named. A token can hold a dozen scopes (permissions), and revoking the wrong one leaves the posting scope alive.
How to check: first the human-readable list. In Facebook open Settings & privacy → Settings → Apps and Websites. Record every entry under Active, then open Expired and Removed — a revoked app that still appears as Active was never actually revoked. Menu wording changes between releases; if a label differs, use the search box inside Settings.
Next, ask the API directly:
export FB_USER_TOKEN="<agent-user-access-token>"
export API_VERSION="<graph-api-version>" # e.g. the version shown in your app dashboard
curl -s -G "https://graph.facebook.com/${API_VERSION}/me/permissions" \
-d "access_token=${FB_USER_TOKEN}" | jq -r '.data[] | [.permission, .status] | @tsv'
Example output (tab-separated, granted scopes only):
public_profile granted
email granted
pages_show_list granted
pages_manage_posts granted
Count the granted scopes and write that number into revoke-audit.txt. If the call returns {"error":{...}} instead of a data array, the token is already dead — skip to Step 3.
Example: an agent built only to draft captions does not need pages_manage_posts. Anything beyond read scopes is a candidate for removal, which is the least-privilege principle: give the program the smallest set of permissions that still lets it finish its job.

What to do: revoke permission by permission through the API, delete the app entry in Facebook, then remove every stored copy of the token from the agent's environment.
Why: revoking on the Facebook side stops new calls, but a cached token in a container will keep retrying and generating failed requests. Repeated failures are what pushes an account toward temporary restrictions.
Start with the narrow case — drop one permission and keep the rest:
curl -s -X DELETE \
"https://graph.facebook.com/${API_VERSION}/me/permissions/pages_manage_posts?access_token=${FB_USER_TOKEN}" | jq
Expected output:
{
"success": true
}
Then revoke everything the token holds, which is the step that actually disconnects the agent:
curl -s -X DELETE \
"https://graph.facebook.com/${API_VERSION}/me/permissions?access_token=${FB_USER_TOKEN}" | jq
Why this works: the DELETE call invalidates the granted scopes server-side, so the token can no longer perform those actions even if a copy survives on disk.
Now remove the app from the account: Settings & privacy → Settings → Apps and Websites → Active → select the app → Remove. Confirm with the Remove button in the dialog.
Finally, purge the runtime. Example of the environment file the agent reads at start:
# before
FB_USER_TOKEN=EAA...
FB_APP_SECRET=...
# after — remove both lines, then rotate the app secret in the app dashboard
Commands to stop stale copies:
docker compose down && docker compose up -d # container env is re-read on start
kubectl rollout restart deployment/<agent-name> # Kubernetes equivalent
unset FB_USER_TOKEN # current shell
How to check: run docker inspect <container> | grep -i -c "EAA" — it must print 0. Run grep -r "EAA" ./agent ~/.env — no matches. If you use a secret manager, confirm the old version is destroyed, not just superseded. If the agent was granted access through a Business Manager system user rather than your personal profile, revoke the system user's token and asset assignment in Business Manager too; those tokens are not listed under Apps and Websites. The exact screen depends on your Business Manager role — check Meta's documentation for "system user tokens" before you touch it.
For a broader threat model around credentials in agent pipelines, see AI agent security: protecting your data during automation, and for keeping agent configs in a predictable layout, ICM in practice: a folder structure that keeps agents manageable.

What to do: prove the token is powerless, then close the behaviours that trigger Facebook's automated security checks.
Why: "I clicked Remove" is not evidence. Verification is a second API call that must come back empty.
How to check: re-run the permissions query.
curl -s -G "https://graph.facebook.com/${API_VERSION}/me/permissions" \
-d "access_token=${FB_USER_TOKEN}" | jq -r '.data[]? | "\(.permission)\t\(.status)"'
Expected result: no output at all, or rows with status declined. Any row still saying granted means the revoke did not apply to that scope — repeat the DELETE for it.
Inspect the token itself:
curl -s -G "https://graph.facebook.com/${API_VERSION}/debug_token" \
--data-urlencode "input_token=${FB_USER_TOKEN}" \
--data-urlencode "access_token=<app-id>|<app-secret>" \
| jq '.data | {is_valid, scopes, expires_at}'
Example output:
{
"is_valid": true,
"scopes": [],
"expires_at": 0
}
is_valid: true with an empty scopes array is a normal, successful end state: the token string exists but carries no permissions. If scopes is not empty, go back to Step 2.
Account-protection checklist — each item removes a known trigger for automated blocks:
(#4) and (#17) errors instead of instant retries.Problem. The agent keeps posting after you revoked access.
(#190) Error validating access token: The session has been invalidated because the user changed their password or Facebook has changed the session for security reasons..env file, or a secret manager cache; the process retries with the old value.docker compose down or kubectl scale deployment/<agent-name> --replicas=0), delete every file matched by grep -rl "EAA" ., destroy the old secret version, rotate the app secret in the app dashboard, then restart and re-run the Step 3 check.Problem. Requests fail with a permission error and the agent retries in a tight loop.
(#200) The user hasn't authorized the application to perform this actionProblem. Call volume suddenly explodes.
(#4) Application request limit reacheddocker ps should show one), process the queue with a delay between calls, and cache responses you already fetched. Meta's exact per-app ceiling is not a fixed public number — check the documentation for the current limits of your app tier.You now hold a written inventory of every app and permission, a token that returns an empty scope list, and an agent runtime with no stored copy of it. Next, add the monthly Apps and Websites review to your calendar and, if you plan to build more agents, read How to turn a regular LLM chat into a full-fledged AI agent so the permission model is designed in from the start.
How do I remove an app's access to my Facebook account?
Settings & privacy → Settings → Apps and Websites → Active, select the app, click Remove. Confirm afterwards with the me/permissions call in Step 3 — the list must be empty.
Does revoking access delete posts the agent already published?
No. Revoking a token removes permission to act; content already created stays on the page and must be deleted manually.
Will my Facebook account get blocked for using an AI agent?
Access through OAuth with a scoped token is the supported path. Restrictions usually follow automated password logins, ignored rate-limit errors, or many duplicate instances — the checklist in Step 3 targets exactly those.
How do I know if an old token is still valid?
Call debug_token with the app access token as shown in Step 3. An empty scopes array means it can no longer do anything; is_valid: false means it is gone entirely.
Status: practical guide. Some statements come from vendors; verify in your environment.
Time to complete: 15–20 minutes Difficulty: Intermediate
Machine data: Citation Map JSON · JSON-LD · Semantic Embeddings — separate stage.
| Entity | Type | Role |
|---|---|---|
| отозвать доступ приложений Facebook | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| Meta AI доступ к аккаунту | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| защита Facebook от блокировки | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| сторонние приложения Facebook | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| как отключить Muse AI Facebook | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| Windows | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| Linux | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| macOS | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| Meta | компания | упоминается в заголовке, TL;DR или разделах гайда |
No independent confirmation is provided; source claims and editorial conclusions are separated below.
| Source | Type | Role |
|---|---|---|
| graph.facebook.com | внешний источник | ссылка из тела гайда |
| graph.facebook.com | внешний источник | ссылка из тела гайда |
| graph.facebook.com | внешний источник | ссылка из тела гайда |
| graph.facebook.com | внешний источник | ссылка из тела гайда |
Cite as: AI Release. Как отозвать доступ ИИ-агента к Facebook и защитить аккаунт от блокировки. ai-release.org.