mirror of https://gitlab.com/bashrc2/epicyon
Reject posts attributed to an LLM
parent
e2bfa0d8b1
commit
05d37e3f7b
10
inbox.py
10
inbox.py
|
|
@ -348,7 +348,7 @@ def inbox_message_has_params(message_json: {}) -> bool:
|
||||||
|
|
||||||
def inbox_permitted_message(domain: str, message_json: {},
|
def inbox_permitted_message(domain: str, message_json: {},
|
||||||
federation_list: []) -> bool:
|
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):
|
if not has_actor(message_json, False):
|
||||||
return 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 message_json['type'] not in always_allowed_types:
|
||||||
if not has_object_dict(message_json):
|
if not has_object_dict(message_json):
|
||||||
return True
|
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'])
|
reply_id = get_reply_to(message_json['object'])
|
||||||
if reply_id:
|
if reply_id:
|
||||||
in_reply_to = reply_id
|
in_reply_to = reply_id
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue