Reject posts attributed to an LLM

main
bashrc 2026-03-22 10:54:01 +00:00
parent e2bfa0d8b1
commit 05d37e3f7b
1 changed files with 9 additions and 1 deletions

View File

@ -348,7 +348,7 @@ def inbox_message_has_params(message_json: {}) -> bool:
def inbox_permitted_message(domain: str, message_json: {},
federation_list: []) -> bool:
""" check that we are receiving from a permitted domain
""" Initial validation of whether an incoming post is permitted
"""
if not has_actor(message_json, False):
return False
@ -368,6 +368,14 @@ def inbox_permitted_message(domain: str, message_json: {},
if message_json['type'] not in always_allowed_types:
if not has_object_dict(message_json):
return True
# reject messages generated by LLM
# See fep-c81b
if 'agentAttribution' in message_json['object']:
if message_json['object'].get('id'):
print("REJECT: inbox post attributed to AI agent " +
str(message_json['object']['id']))
return False
# if this is a reply check that replyTo is permitted
reply_id = get_reply_to(message_json['object'])
if reply_id:
in_reply_to = reply_id