akira If i state agency confiscate my phone they can't get access to my files because of the encryption
The encryption works differently when the bootloader is unlocked. As the GrapheneOS project account mentioned, there's also no protection of the Device Encrypted (DE) data in BFU state. Important user data is saved in Credentials Encrypted (CE) storage, though. It's my belief that if your OS hasn't been compromised (that's a wild assumption because with an unlocked bootloader an attacker has to succeed only once, ever, in compromising it to permanently compromise it), you use a strong password (not a PIN or a weak password), and the attacker finds your phone in a BFU or powered off state already, then there's nothing they can do to decrypt your CE data. Normally, with a locked bootloader, the secure element is involved in the encryption, and the verified boot key of the booted OS is also involved in the encryption. The answer that @GrapheneOS posted suggests that, with an unlocked bootloader, the former's involvement is much reduced somehow, and you can be sure that the latter is definitely not involved because the OS isn't identified or verified with a key at all. I'm interested to see what @GrapheneOS has to say about this.
akira They can install another system rom because of the unlocked bootloader and return my phone, and assuming i am stupid enough to unlock the phone, instead of wiping all data immediately
Wiping your data would do nothing to secure “your” “phone”. You go into a phone shop. You buy a Pixel phone to install GrapheneOS on it. How can you know it's an authentic, untampered Pixel phone? The state confiscates your phone. They want to attack you and get all your data. They give you a device looking like your phone. How can you know it's your authentic, untampered Pixel phone?
Purchasing an authentic Pixel phone, not a counterfeit or something that has a hardware modification that spies on you, is very important. Why are you willing to “buy” a “phone” from a state attacker that you know (once they actually confiscate your phone) are trying ti get your data? This makes no sense and there's absolutely nothing you can do to secure the device they give you. Throw it to the trash and buy a new one.
akira I don't know if i am correct but this is my understanding of the answers in the thread.
You seem very concerned with your security. You need to lock your bootloader.