He signed the agreement. That was foolish. The meaning of these two sentences can be conveyed as;
1
He foolishly signed the agreement.
2
The agreement was foolish to be signed.
3
He was fooled because of the agreement.
4
The agreement made him a fool.