How can we filter GET helper with internal tags inside the post context

I want to filter related posts based on the internal tags in a post.

The following code is working fine for public tags

{{#get "posts" limit="5" filter="tags:[{{tags[*].slug}}]+id:-{{id}}" include="authors" as |related_posts|}}
	{{#if related_posts}}

Is there any way we can use the visibility="internal" attribute in tags helper to filter the internal tags out?

I have tried both of the following methods.

{{#get "posts" limit="5" filter="tags:[{{#if tags}}{{#foreach tags visibility="all"}}{{#has visibility="internal"}}{{slug}}{{/has}}{{/foreach}}{{/if}}]+id:-{{id}}" include="authors" as |related_posts|}}



{{#get "posts" limit="5" filter="tags:[{{tags[*].slug visibility="internal"}}]+id:-{{id}}" include="authors" as |related_posts|}}


But as soon as I use the visibility="internal" attribute, it throws an error.
Any advice would be greatly appreciated.

Thank you.